home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / elflib.zip / ELF.DOC < prev    next >
Text File  |  1992-12-01  |  180KB  |  4,048 lines

  1.  
  2.  
  3.  
  4.  
  5.                                          ELF
  6.  
  7.  
  8.                             EXTENDED LISP FUNCTION LIBRARY
  9.                                      for AutoLISP
  10.  
  11.  
  12.                               Version 1.0 Documentation
  13.                                  and Reference Manual
  14.  
  15.                                    December 1, 1992
  16.  
  17.  
  18.  
  19.                                    _______
  20.                               ____|__     |               (R)
  21.                            --|       |    |-------------------
  22.                              |   ____|__  |  Association of
  23.                              |  |       |_|  Shareware
  24.                              |__|   o   |    Professionals
  25.                            -----|   |   |---------------------
  26.                                 |___|___|    MEMBER
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                                 Mountain Software
  34.  
  35.  
  36.                           Autodesk Registered Developer
  37.  
  38.  
  39.  
  40.                                1579 Nottingham Road
  41.                                Charleston, WV 25314
  42.  
  43.                                  CIS 70717,3564 
  44.                               Orders: 1-800-2424-PsL
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                       Copyright 1992 Jerome Lee Workman, jr.
  59.                                all rights reserved
  60.  
  61.  
  62.                           EXTENDED LISP FUNCTION LIBRARY
  63.  
  64.                                 Table of Contents
  65.  
  66.  
  67.  
  68.         Using ELF
  69.           Introduction  . . . . . . . . . . . . . . . . . . . . . . .   1
  70.           ELF Features  . . . . . . . . . . . . . . . . . . . . . . .   1
  71.           Installation  . . . . . . . . . . . . . . . . . . . . . . .   3
  72.           ACAD.ADS  . . . . . . . . . . . . . . . . . . . . . . . . .   3
  73.           ACAD.LSP  . . . . . . . . . . . . . . . . . . . . . . . . .   4
  74.           Sample Programs . . . . . . . . . . . . . . . . . . . . . .   4
  75.  
  76.         ELFDOS Commands
  77.           cd  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5
  78.              change directories; chdir, dcd
  79.           cls . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5
  80.              clear (erase) the text screen; 
  81.           c:  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5
  82.              logs to C: drive; 
  83.           dcopy . . . . . . . . . . . . . . . . . . . . . . . . . . .   6
  84.              copy DOS file(s); 
  85.           derase  . . . . . . . . . . . . . . . . . . . . . . . . . .   6
  86.              erase / delete DOS file(s); ddel
  87.           dir . . . . . . . . . . . . . . . . . . . . . . . . . . . .   6
  88.              prints a file directory list; ddir
  89.           drename . . . . . . . . . . . . . . . . . . . . . . . . . .   6
  90.              rename / move file(s); dmove
  91.           elf . . . . . . . . . . . . . . . . . . . . . . . . . . . .   7
  92.              displays a list of all ELF commands and functions; 
  93.           ff  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   7
  94.              find file(s) on the AutoCAD library path and DOS path; 
  95.           look  . . . . . . . . . . . . . . . . . . . . . . . . . . .   7
  96.              display ASCII file(s) to the screen using the ELF browser;
  97.  
  98.           mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . .   8
  99.              create a directory; md, dmd
  100.           password  . . . . . . . . . . . . . . . . . . . . . . . . .   8
  101.              register  ELF  with  your password  (obtain  from Mountain
  102.              Software); 
  103.           rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . .   8
  104.              remove (delete) a directory; rd, drd
  105.           sd  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   9
  106.              set default disk drive; dsd
  107.           symbol  . . . . . . . . . . . . . . . . . . . . . . . . . .   9
  108.              displays the value of an AutoLISP symbol; 
  109.           ver . . . . . . . . . . . . . . . . . . . . . . . . . . . .   9
  110.              prints ELF, DOS and AutoCAD version numbers; 
  111.  
  112.         AutoLISP Functions
  113.           Optional Parameters . . . . . . . . . . . . . . . . . . . .  10
  114.           Variable Parameters . . . . . . . . . . . . . . . . . . . .  10
  115.           Data Types  . . . . . . . . . . . . . . . . . . . . . . . .  10
  116.           Return Values . . . . . . . . . . . . . . . . . . . . . . .  11
  117.  
  118.  
  119.         ELF Documentation                      Table of Contents, Page ii
  120.  
  121.  
  122.         Video Functions
  123.           box . . . . . . . . . . . . . . . . . . . . . . . . . . . .  12
  124.              draws a  box (rectangle) on the  text screen using graphic
  125.              ascii characters.; (box col row ecol erow attr btype)
  126.           cls . . . . . . . . . . . . . . . . . . . . . . . . . . . .  12
  127.              clear text screen to optional color attribute; (cls attr)
  128.           get_video . . . . . . . . . . . . . . . . . . . . . . . . .  12
  129.              get current text screen video parameters; (get_video)
  130.           printf  . . . . . . . . . . . . . . . . . . . . . . . . . .  13
  131.              formatted  "C"  type print  to  text  screen  or  graphics
  132.              command prompt area; (printf format ...)
  133.           prts  . . . . . . . . . . . . . . . . . . . . . . . . . . .  13
  134.              fast  write  to  text screen  at  col,  row  position with
  135.              optional attribute; (prts col row string attr)
  136.           puts  . . . . . . . . . . . . . . . . . . . . . . . . . . .  13
  137.              fast write to text screen at cursor position with optional
  138.              attribute; (puts string attr)
  139.           restore_screen  . . . . . . . . . . . . . . . . . . . . . .  14
  140.              restores    a    previously    captured    text    screen;
  141.              (restore_screen)
  142.           save_screen . . . . . . . . . . . . . . . . . . . . . . . .  14
  143.              captures the  contents of  the  text  screen to  a  memory
  144.              buffer; (save_screen)
  145.           scr_fill  . . . . . . . . . . . . . . . . . . . . . . . . .  14
  146.              fill a rectangle  of the text screen  with a character and
  147.              color attribute; (scr_fill col row cols rows ch attr)
  148.           scr_printf  . . . . . . . . . . . . . . . . . . . . . . . .  15
  149.              formatted "C" type print to text screen using direct video
  150.              buffer write; (scr_printf format ...)
  151.           set_color . . . . . . . . . . . . . . . . . . . . . . . . .  15
  152.              sets the internal  "color" variable for use  by subsequent
  153.              uses  of routines which can  use the default  color (r11);
  154.              (set_color attr)
  155.  
  156.         Cursor Functions
  157.           get_cursor  . . . . . . . . . . . . . . . . . . . . . . . .  16
  158.              get cursor size / shape; (get_cursor)
  159.           getxy . . . . . . . . . . . . . . . . . . . . . . . . . . .  16
  160.              get cursor screen coordinates; (getxy)
  161.           gotoxy  . . . . . . . . . . . . . . . . . . . . . . . . . .  16
  162.              position the screen cursor; (gotoxy col row)
  163.           set_cursor  . . . . . . . . . . . . . . . . . . . . . . . .  16
  164.              set  cursor size;  start  to end  scan lines;  (set_cursor
  165.              start end)
  166.  
  167.         Window Functions
  168.           set_menu_help . . . . . . . . . . . . . . . . . . . . . . .  17
  169.              sets the user  help string list for  wmenu; (set_menu_help
  170.              <slist>)
  171.           wclose  . . . . . . . . . . . . . . . . . . . . . . . . . .  18
  172.              closes  the  top  window  restoring the  screen  under the
  173.              window; (wclose)
  174.           wcloseall . . . . . . . . . . . . . . . . . . . . . . . . .  18
  175.              closes all windows; (wcloseall)
  176.  
  177.  
  178.         ELF Documentation                     Table of Contents, Page iii
  179.  
  180.  
  181.           wclreol . . . . . . . . . . . . . . . . . . . . . . . . . .  18
  182.              erase from window cursor to end of line; (wclreol)
  183.           wcls  . . . . . . . . . . . . . . . . . . . . . . . . . . .  18
  184.              clear window to optional color attribute; (wcls attr)
  185.           werase_line . . . . . . . . . . . . . . . . . . . . . . . .  19
  186.              erase a line of text from a window; (werase_line line)
  187.           wgetstr . . . . . . . . . . . . . . . . . . . . . . . . . .  19
  188.              open a window centered on the text screen, prints a prompt
  189.              on the top border and gets  string input.; (wgetstr prompt
  190.              default length wattr battr btype)
  191.           wgetdrive . . . . . . . . . . . . . . . . . . . . . . . . .  19
  192.              select  a disk  drive from  a menu,  all valid  drives are
  193.              listed   with    their   respective    drive   type    (eg
  194.              removable/floppy, fixed, network, and redirected devices);
  195.              (wgetdrive col row wattr battr hattr btype)
  196.           wgetfile  . . . . . . . . . . . . . . . . . . . . . . . . .  20
  197.              select a file from  a menu of  DOS files from the  current
  198.              directory.  The user can change directories and access all
  199.              available disk  drives.; (wgetfile  filespec fileattr  col
  200.              row wattr battr hattr btype)
  201.           wgetxy  . . . . . . . . . . . . . . . . . . . . . . . . . .  21
  202.              get window screen position; (wgetxy)
  203.           wgotoxy . . . . . . . . . . . . . . . . . . . . . . . . . .  21
  204.              move window cursor; (wgotoxy col row)
  205.           winfo . . . . . . . . . . . . . . . . . . . . . . . . . . .  21
  206.              gets the top window size and position; (winfo)
  207.           wmenu . . . . . . . . . . . . . . . . . . . . . . . . . . .  22
  208.              opens a centered window  and displays a menu. The user can
  209.              then  select one  of  the displayed  items.; (wmenu  slist
  210.              wattr battr hattr btype shadow title)
  211.           wmsg  . . . . . . . . . . . . . . . . . . . . . . . . . . .  23
  212.              opens a centered window, displays a message and optionally
  213.              waits for  a keystroke  and closes the  window; (wmsg  str
  214.              wait attr battr btype)
  215.           wopen . . . . . . . . . . . . . . . . . . . . . . . . . . .  24
  216.              open a window on the text  screen with specified location,
  217.              size,  border,  and colors;  saving  the  area  under  the
  218.              window; (wopen col row cols rows wattr battr btype)
  219.           wpopup  . . . . . . . . . . . . . . . . . . . . . . . . . .  24
  220.              open a window  centered on the  text screen;  (wpopup cols
  221.              rows wattr battr)
  222.           wprintf . . . . . . . . . . . . . . . . . . . . . . . . . .  25
  223.              printf  to  window at  window  cursor  position;  (wprintf
  224.              format ...)
  225.           wprts . . . . . . . . . . . . . . . . . . . . . . . . . . .  25
  226.              write  to  window  at  col,  row  position  with  optional
  227.              attribute; (wprts col row string attr)
  228.           wputcen . . . . . . . . . . . . . . . . . . . . . . . . . .  25
  229.              write a centered  string to  window at  window cursor  row
  230.              position; (wputcen str)
  231.           wputs . . . . . . . . . . . . . . . . . . . . . . . . . . .  26
  232.              write  to window at  window cursor position  with optional
  233.              attribute; (puts string attr)
  234.           wscroll . . . . . . . . . . . . . . . . . . . . . . . . . .  26
  235.  
  236.  
  237.         ELF Documentation                      Table of Contents, Page iv
  238.  
  239.  
  240.              scroll window text; (wscroll dir start end lines)
  241.           wshadow . . . . . . . . . . . . . . . . . . . . . . . . . .  26
  242.              adds  a  drop shadow  to  the  top  (last opened)  window;
  243.              (wshadow attr)
  244.           wtitle  . . . . . . . . . . . . . . . . . . . . . . . . . .  27
  245.              prints on the border  of a window  in one of 6  positions;
  246.              (wtitle <str> [<pos>])
  247.  
  248.         Keyboard Functions
  249.           getch . . . . . . . . . . . . . . . . . . . . . . . . . . .  27
  250.              get a character from the keyboard; (getch)
  251.           getche  . . . . . . . . . . . . . . . . . . . . . . . . . .  28
  252.              get a character from the keyboard with echo; (getche)
  253.           getkey  . . . . . . . . . . . . . . . . . . . . . . . . . .  28
  254.              get a keystroke from the keyboard; (getkey)
  255.           kbhit . . . . . . . . . . . . . . . . . . . . . . . . . . .  28
  256.              checks  the  keyboard  buffer  for  a  waiting  keystroke;
  257.              (kbhit)
  258.           key_clear . . . . . . . . . . . . . . . . . . . . . . . . .  29
  259.              clears  the  keyboard buffer  of  any pending  keystrokes;
  260.              (key_clear)
  261.           key_ready . . . . . . . . . . . . . . . . . . . . . . . . .  29
  262.              returns immediately with a waiting key; (key_ready)
  263.           key_stat  . . . . . . . . . . . . . . . . . . . . . . . . .  29
  264.              gets the state of  keyboard shift and other special  keys;
  265.              (key_stat)
  266.           key_stuff . . . . . . . . . . . . . . . . . . . . . . . . .  29
  267.              "pushes" keys into the keyboard buffer; (key_stuff str)
  268.  
  269.         Directory Functions
  270.           access  . . . . . . . . . . . . . . . . . . . . . . . . . .  30
  271.              determines if a  file exists and can  be accessed by mode;
  272.              (access path mode)
  273.           chdir . . . . . . . . . . . . . . . . . . . . . . . . . . .  30
  274.              change disk directory; (chdir path)
  275.           chpath  . . . . . . . . . . . . . . . . . . . . . . . . . .  31
  276.              change current disk drive and directory; (chpath path)
  277.           disk_ready  . . . . . . . . . . . . . . . . . . . . . . . .  31
  278.              verifies  that a  removable  (floppy) drive  is ready  and
  279.              readable; (disk_ready drive)
  280.           disk_type . . . . . . . . . . . . . . . . . . . . . . . . .  31
  281.              ; (disk_type drive)
  282.           disk_valid  . . . . . . . . . . . . . . . . . . . . . . . .  31
  283.              verifies  that a  disk drive  is a  valid device  (but not
  284.              necessarily   ready    if   a   removable/floppy   drive);
  285.              (disk_valid drive)
  286.           erasefile . . . . . . . . . . . . . . . . . . . . . . . . .  32
  287.              erase file(s); (erasefile filename)
  288.           file_exists . . . . . . . . . . . . . . . . . . . . . . . .  32
  289.              determines if a file exists; (file_exists path)
  290.           findfirst . . . . . . . . . . . . . . . . . . . . . . . . .  32
  291.              finds  the  first  instance  of  a  file  who's  name  and
  292.              directory  attributes  match  the  arguments.;  (findfirst
  293.              filespec attribute)
  294.  
  295.  
  296.         ELF Documentation                       Table of Contents, Page v
  297.  
  298.  
  299.           findnext  . . . . . . . . . . . . . . . . . . . . . . . . .  33
  300.              finds  the next occurrence  of the file  specification and
  301.              attribute after a findfirst call; (findnext)
  302.           fullpath  . . . . . . . . . . . . . . . . . . . . . . . . .  34
  303.              expands  a partial  path  into  a full  DOS  path  string;
  304.              (fullpath path)
  305.           getdir  . . . . . . . . . . . . . . . . . . . . . . . . . .  34
  306.              returns a string with the current drive:\path; (getdir)
  307.           getdiskfree . . . . . . . . . . . . . . . . . . . . . . . .  34
  308.              returns size statistics in the specified drive number as a
  309.              list; (getdiskfree 3)
  310.           getdisk . . . . . . . . . . . . . . . . . . . . . . . . . .  35
  311.              returns the  current drive  number (A=1,  B=2, C=3,  etc);
  312.              (getdisk)
  313.           load_dirs . . . . . . . . . . . . . . . . . . . . . . . . .  35
  314.              returns a list of strings containing file directories from
  315.              the current directory; (load_dirs)
  316.           load_drives . . . . . . . . . . . . . . . . . . . . . . . .  35
  317.              returns  a  list of  strings  containing  all  valid  disk
  318.              drives; (load_drives)
  319.           load_files  . . . . . . . . . . . . . . . . . . . . . . . .  35
  320.              returns  a list  of  strings containing  files matching  a
  321.              filespec  and  directory  attribute; (load_files  filespec
  322.              attribute)
  323.           makepath  . . . . . . . . . . . . . . . . . . . . . . . . .  36
  324.              Combines the four components  into a full DOS path string;
  325.              (makepath drive dir name ext)
  326.           mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . .  36
  327.              creates a new directory; (mkdir dirname)
  328.           rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . .  36
  329.              removes (deletes) a directory; (rmdir dirname)
  330.           setdisk . . . . . . . . . . . . . . . . . . . . . . . . . .  36
  331.              logs to the specified disk drive; (setdisk drive)
  332.           splitpath . . . . . . . . . . . . . . . . . . . . . . . . .  37
  333.              splits  a  DOS  path  string  into  its  four  components;
  334.              (splitpath path)
  335.           unlink  . . . . . . . . . . . . . . . . . . . . . . . . . .  37
  336.              erase file(s); (unlink filename)
  337.  
  338.         File Functions
  339.           copyfile  . . . . . . . . . . . . . . . . . . . . . . . . .  38
  340.              copies file(s); (copyfile source destination)
  341.           look  . . . . . . . . . . . . . . . . . . . . . . . . . . .  38
  342.              displays  an  ASCII file  to  screen  using the  ELF  file
  343.              viewer; (look filespec)
  344.           movefile  . . . . . . . . . . . . . . . . . . . . . . . . .  38
  345.              moves / renames file(s); (movefile source destination)
  346.           read_file . . . . . . . . . . . . . . . . . . . . . . . . .  38
  347.              reads an  ASCII file and  returns a string  list from file
  348.              records.  Each line  in  the text  file is  parsed  into a
  349.              string  and appended  to  the returned  list.;  (read_file
  350.              filespec mode)
  351.  
  352.  
  353.         ELF Documentation                      Table of Contents, Page vi
  354.  
  355.  
  356.           write_file  . . . . . . . . . . . . . . . . . . . . . . . .  39
  357.              opens an  ASCII file and writes a string  list to the file
  358.              and then  closes the  file. Each  string is placed  in the
  359.              text file as a line of text.; (write_file filespec type)
  360.  
  361.         Math Functions
  362.           | . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  39
  363.              returns the  result of a  bitwise OR of  the arguments; (|
  364.              ...)
  365.           ||  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  40
  366.              returns the result  of a logical OR  of the arguments; (||
  367.              ...)
  368.           & . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  40
  369.              returns the result  of a bitwise AND  of the arguments; (&
  370.              ...)
  371.           &&  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  40
  372.              returns the result of  a logical AND of the arguments; (&&
  373.              ...)
  374.           acos  . . . . . . . . . . . . . . . . . . . . . . . . . . .  40
  375.              returns the inverse cosine of the argument; (acos rad)
  376.           asin  . . . . . . . . . . . . . . . . . . . . . . . . . . .  40
  377.              returns the inverse sine of the argument; (asin rad)
  378.           ceil  . . . . . . . . . . . . . . . . . . . . . . . . . . .  41
  379.              returns  the  smallest  integer  greater or  equal  to the
  380.              argument; (ceil rval)
  381.           cosh  . . . . . . . . . . . . . . . . . . . . . . . . . . .  41
  382.              returns the hyperbolic cosine of the argument; (cosh rad)
  383.           dtr . . . . . . . . . . . . . . . . . . . . . . . . . . . .  41
  384.              converts an angle in degrees to radians; (dtr ang)
  385.           floor . . . . . . . . . . . . . . . . . . . . . . . . . . .  41
  386.              returns the largest integer not greater than the argument;
  387.              (floor rval)
  388.           hibyte  . . . . . . . . . . . . . . . . . . . . . . . . . .  42
  389.              returns the upper  (most significant) byte of  an integer;
  390.              (hibyte val)
  391.           lobyte  . . . . . . . . . . . . . . . . . . . . . . . . . .  42
  392.              returns  the lower (least significant) byte of an integer;
  393.              (lobyte val)
  394.           log10 . . . . . . . . . . . . . . . . . . . . . . . . . . .  42
  395.              returns the  logarithm to  the base  10  of the  argument;
  396.              (log10 x)
  397.           rand  . . . . . . . . . . . . . . . . . . . . . . . . . . .  42
  398.              generates a pseudo random number; (rand)
  399.           round . . . . . . . . . . . . . . . . . . . . . . . . . . .  42
  400.              rounds a real value; (round val places)
  401.           rtd . . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  402.              converts an angle in radians to degrees; (rtd ang)
  403.           sinh  . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  404.              returns the hyperbolic sine of the argument; (sinh rad)
  405.           srand . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  406.              seeds the random number generator; (srand i)
  407.           tan . . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  408.              returns  the trigonometric tangent  of the  argument; (tan
  409.              rad)
  410.  
  411.  
  412.         ELF Documentation                     Table of Contents, Page vii
  413.  
  414.  
  415.           tanh  . . . . . . . . . . . . . . . . . . . . . . . . . . .  44
  416.              returns the hyperbolic tangent of the argument; (tanh rad)
  417.  
  418.         List Handling Functions
  419.           bsearch . . . . . . . . . . . . . . . . . . . . . . . . . .  44
  420.              located a value in  a sorted string, integer or real value
  421.              list; (bsearch vlist key)
  422.           delete  . . . . . . . . . . . . . . . . . . . . . . . . . .  44
  423.              deletes  a list or  atom from  another list;  (delete list
  424.              pos)
  425.           insert  . . . . . . . . . . . . . . . . . . . . . . . . . .  45
  426.              inserts a list or atom into another list; (insert list pos
  427.              item)
  428.           lfind . . . . . . . . . . . . . . . . . . . . . . . . . . .  45
  429.              located a  value in  an unsorted string,  integer or  real
  430.              value list; (lfind vlist key)
  431.           lsearch . . . . . . . . . . . . . . . . . . . . . . . . . .  45
  432.              located a value  in a string, integer  or real value list;
  433.              (lsearch vlist key)
  434.           qsort . . . . . . . . . . . . . . . . . . . . . . . . . . .  46
  435.              sorts a string, integer or real value list; (qsort lst)
  436.           replace . . . . . . . . . . . . . . . . . . . . . . . . . .  46
  437.              replace a  list or atom  in a list  with another; (replace
  438.              list pos item)
  439.           symbol  . . . . . . . . . . . . . . . . . . . . . . . . . .  46
  440.              Displays the contents of  a symbol to the screen using the
  441.              ELF file/symbol viewer.; (symbol sym)
  442.  
  443.         String Handling Functions
  444.           field . . . . . . . . . . . . . . . . . . . . . . . . . . .  47
  445.              returns a substring of str1  from token delimiters in str2
  446.              and position.; (field str1 str2 pos)
  447.           set_edit_help . . . . . . . . . . . . . . . . . . . . . . .  47
  448.              sets the  user help string list for the function (strget);
  449.              (set_edit_help <slist>)
  450.           sprintf . . . . . . . . . . . . . . . . . . . . . . . . . .  47
  451.              same as printf except that nothing is printed,  the string
  452.              is returned; (sprintf format ...)
  453.           strchr  . . . . . . . . . . . . . . . . . . . . . . . . . .  48
  454.              finds  the first  occurrence of  ch in  str and  returns a
  455.              substring starting at that character; (strchr str ch)
  456.           strcmp  . . . . . . . . . . . . . . . . . . . . . . . . . .  48
  457.              compares  two  strings  for   equality  (case  sensitive);
  458.              (strcmp str1 str2)
  459.           strcspn . . . . . . . . . . . . . . . . . . . . . . . . . .  48
  460.              determine  the length of the prefix  of str1 made entirely
  461.              of chars not in str2; (strcspn str1 str2)
  462.           strdate . . . . . . . . . . . . . . . . . . . . . . . . . .  49
  463.              returns the  current date  from the  internal  clock as  a
  464.              formatted string; (strdate)
  465.           strdela . . . . . . . . . . . . . . . . . . . . . . . . . .  49
  466.              delete  all  occurrences  of  chars  in  str2  from  str1;
  467.              (strdela str1 str2)
  468.           strget  . . . . . . . . . . . . . . . . . . . . . . . . . .  49
  469.  
  470.  
  471.         ELF Documentation                    Table of Contents, Page viii
  472.  
  473.  
  474.              edit  a string on the text  screen with cursor positioning
  475.              and editing, background mask, color attribute control, and
  476.              on line help.; (strget str len curpos mask attr ...)
  477.           stricmp . . . . . . . . . . . . . . . . . . . . . . . . . .  50
  478.              compares  two strings  for  equality  (case  insensitive);
  479.              (stricmp str1 str2)
  480.           strncpy . . . . . . . . . . . . . . . . . . . . . . . . . .  51
  481.              copies the first n characters of a string; (strncpy str n)
  482.           strnset . . . . . . . . . . . . . . . . . . . . . . . . . .  51
  483.              fills a string; (strnset char len)
  484.           strpbrk . . . . . . . . . . . . . . . . . . . . . . . . . .  51
  485.              returns  a  substring  of  the  first  occurrence  of  any
  486.              character of str2 in str1; (strstr str1 str2)
  487.           strrchr . . . . . . . . . . . . . . . . . . . . . . . . . .  51
  488.              finds  the last  occurrence  of ch  in str  and  returns a
  489.              substring starting at that character; (strrchr str ch)
  490.           strrev  . . . . . . . . . . . . . . . . . . . . . . . . . .  52
  491.              returns the  string  argument  with  the  character  order
  492.              reversed; (strrev str)
  493.           strspn  . . . . . . . . . . . . . . . . . . . . . . . . . .  52
  494.              determine the  length of the prefix  of str1 made entirely
  495.              of chars in str2; (strspn str1 str2)
  496.           strstr  . . . . . . . . . . . . . . . . . . . . . . . . . .  52
  497.              returns a  substring of  the first occurrence  of str2  in
  498.              str1; (strstr str1 str2)
  499.           strswap . . . . . . . . . . . . . . . . . . . . . . . . . .  52
  500.              swaps all occurrences of char1 with char2 in str; (strswap
  501.              str char1 char2)
  502.           strtime . . . . . . . . . . . . . . . . . . . . . . . . . .  53
  503.              returns  the current  time from  the  internal clock  as a
  504.              formatted string; (strtime)
  505.           strtok  . . . . . . . . . . . . . . . . . . . . . . . . . .  53
  506.              returns  the first substring of str1 from token delimiters
  507.              in   str2.  subsequent  calls  after  the  first  with  no
  508.              arguments  will   return  the   second  and   any  further
  509.              substrings; (strtok str1 str2)
  510.           strtrim . . . . . . . . . . . . . . . . . . . . . . . . . .  53
  511.              trim  white  space  (all  char  values  <  '!')  from  the
  512.              beginning (left side) and end (right side); and compresses
  513.              white space  within a  string to  a  single space  between
  514.              words; (strtrim str)
  515.           strtriml  . . . . . . . . . . . . . . . . . . . . . . . . .  54
  516.              trim  white  space  from the  beginning  (left side)  of a
  517.              string; (strtriml str)
  518.           strtrimr  . . . . . . . . . . . . . . . . . . . . . . . . .  54
  519.              trim white  space from the  end (right side)  of a string;
  520.              (strtrimr str)
  521.           tolower . . . . . . . . . . . . . . . . . . . . . . . . . .  54
  522.              ; (tolower char)
  523.           toupper . . . . . . . . . . . . . . . . . . . . . . . . . .  54
  524.              ; (toupper char)
  525.  
  526.         Character Classification Functions
  527.           isalnum . . . . . . . . . . . . . . . . . . . . . . . . . .  55
  528.  
  529.  
  530.         ELF Documentation                      Table of Contents, Page ix
  531.  
  532.  
  533.              returns a non-zero value if argument is a letter or digit;
  534.              (isalnum char)
  535.           isascii . . . . . . . . . . . . . . . . . . . . . . . . . .  55
  536.              returns  a  non-zero   value  if  argument  is   an  ASCII
  537.              character; (isascii char)
  538.           iscntl  . . . . . . . . . . . . . . . . . . . . . . . . . .  55
  539.              returns   a  non-zero  value  if  argument  is  a  control
  540.              character; (iscntl char)
  541.           isdigit . . . . . . . . . . . . . . . . . . . . . . . . . .  55
  542.              returns  a non-zero value if argument  is a numeric digit;
  543.              (isdigit char)
  544.           isgraph . . . . . . . . . . . . . . . . . . . . . . . . . .  56
  545.              returns   a  non-zero  value  if  argument  is  a  visible
  546.              printable character; (isgraph char)
  547.           islower . . . . . . . . . . . . . . . . . . . . . . . . . .  56
  548.              returns  a  non-zero  value if  argument  is a  lower case
  549.              letter; (islower char)
  550.           isodigit  . . . . . . . . . . . . . . . . . . . . . . . . .  56
  551.              returns a non-zero value if argument is an octal digit (0-
  552.              7); (isodigit char)
  553.           isprint . . . . . . . . . . . . . . . . . . . . . . . . . .  56
  554.              returns  a  non-zero value  if  argument  is  a  printable
  555.              character; (isprint char)
  556.           ispunct . . . . . . . . . . . . . . . . . . . . . . . . . .  57
  557.              returns  a non-zero  value  if argument  is a  punctuation
  558.              character; (ispunct char)
  559.           isspace . . . . . . . . . . . . . . . . . . . . . . . . . .  57
  560.              returns  a non-zero  value  if argument  is a  white-space
  561.              character (space, tab, newline, etc); (isspace char)
  562.           isupper . . . . . . . . . . . . . . . . . . . . . . . . . .  57
  563.              returns a  non-zero value  if argument  is  an upper  case
  564.              letter; (isupper char)
  565.           isxdigit  . . . . . . . . . . . . . . . . . . . . . . . . .  57
  566.              returns  a non-zero  value  if argument  is a  hexadecimal
  567.              digit (0-F); (isxdigit char)
  568.  
  569.         Utility / Miscellaneous Functions
  570.           adsdump . . . . . . . . . . . . . . . . . . . . . . . . . .  58
  571.              prints  the data  type and  value  of an  AutoLISP symbol;
  572.              (adsdump sym)
  573.           beep  . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
  574.              sound a beep on  the PC speaker for optional frequency and
  575.              duration; (beep freq duration)
  576.           clock . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
  577.              reads the current internal clock; (clock)
  578.           exit  . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
  579.              cancels  execution  and returns  to  the  Command: prompt;
  580.              (exit)
  581.           getdosver . . . . . . . . . . . . . . . . . . . . . . . . .  59
  582.              returns the DOS version; (getdosver)
  583.           last_error  . . . . . . . . . . . . . . . . . . . . . . . .  59
  584.              returns the last internal error message; (last_error)
  585.           nosound . . . . . . . . . . . . . . . . . . . . . . . . . .  59
  586.              turns off the PC speaker after a sound function; (nosound)
  587.  
  588.  
  589.         ELF Documentation                       Table of Contents, Page x
  590.  
  591.  
  592.           pause_key . . . . . . . . . . . . . . . . . . . . . . . . .  59
  593.              prints "press  any  key to  continue..." and  waits for  a
  594.              keystroke; (pause_key)
  595.           sound . . . . . . . . . . . . . . . . . . . . . . . . . . .  59
  596.              turns on  the PC speaker  at a  specified tone  frequency;
  597.              (sound freq)
  598.           system  . . . . . . . . . . . . . . . . . . . . . . . . . .  60
  599.              executes a DOS command; (system cmd)
  600.           wait  . . . . . . . . . . . . . . . . . . . . . . . . . . .  60
  601.              suspend execution for a specified time duration; (wait ti)
  602.  
  603.         Symbols
  604.           *last_error*  . . . . . . . . . . . . . . . . . . . . . . .  60
  605.              the last error message string
  606.           color . . . . . . . . . . . . . . . . . . . . . . . . . . .  60
  607.              default color attribute
  608.           edit_help . . . . . . . . . . . . . . . . . . . . . . . . .  60
  609.              string  list  with user  defined  help  for  the  (strget)
  610.              function
  611.           menu_help . . . . . . . . . . . . . . . . . . . . . . . . .  60
  612.              string  list  with  user  defined  help  for  the  (wmenu)
  613.              function
  614.           Copyright . . . . . . . . . . . . . . . . . . . . . . . . .  62
  615.           Trademark . . . . . . . . . . . . . . . . . . . . . . . . .  62
  616.  
  617.  
  618.         Elf Documentation                                          Page 1
  619.  
  620.  
  621.  
  622.         Using ELF
  623.  
  624.         Introduction
  625.  
  626.         ELF is  a library of  commands and functions designed  to enhance
  627.         AutoCAD and  AutoLISP. The  ELF library  contains 15 utility  and
  628.         file management commands, and over 150 functions for AutoLISP all
  629.         contained in a single EXP file.
  630.  
  631.         ELF gives  the  AutoLISP programmer  a  professional  programming
  632.         language  rivaling many  commercial compiled  language libraries.
  633.         The range  of functions include  those for text screen  video and
  634.         window control; popup menus and  data entry with a build  in help
  635.         system; sound; keyboard;  string manipulation; math;  sorting and
  636.         searching;  list  handling; file  and directory  handling; entity
  637.         creation; and several utility functions.
  638.  
  639.         Non-programmers  will   also  appreciate   the  mini-applications
  640.         (ELFapps), including  the ELF  notepad; and  the several  utility
  641.         commands.
  642.  
  643.         In  addition,  ELF  contains ELFDOS,  which  implements  many DOS
  644.         commands  within AutoCAD for  file management, a  file and symbol
  645.         browser, and integrated help.
  646.  
  647.         ELF is designed  to operate with AutoCAD 386  (release 10-386 and
  648.         above) on  IBM PC  and  compatible computers  under the  MS/PCDOS
  649.         operating system.
  650.  
  651.  
  652.         ELF Features
  653.  
  654.         *  Over 150 new functions for AutoLISP programmers:
  655.              + Video
  656.                   -    fast direct video writes to the text screen
  657.                   -    printf for C programmers
  658.                   -    color attribute control
  659.                   -    screen save, fill, and restore
  660.              + Text screen windowing
  661.                   -    22 functions for full window management
  662.                   -    multiple overlapping  windows with  shaded borders
  663.                        and drop shadows      
  664.                   -    menus and line editor with integrated user defined
  665.                        help system      
  666.                   -    a file dialogue
  667.              + Cursor
  668.                   -    cursor positioning
  669.                   -    cursor size shape
  670.              + Keyboard
  671.                   -    getkey, getch, getche, and kbhit functions
  672.                   -    keyboard status
  673.                   -    stuff keyboard buffer with keystrokes
  674.              + Directory
  675.  
  676.  
  677.         Elf Documentation                                          Page 2
  678.  
  679.  
  680.                   -    create / remove / change directories
  681.                   -    read / verify / log to all disk drives
  682.                   -    read disk directory and disk statistics
  683.                   -    copy, move, erase, and rename files.
  684.                   -    file path manipulation
  685.              + File
  686.                   -    fast one step ASCII file read and write
  687.              + Math
  688.                   -    expanded trig, logical, and bit manipulation
  689.              + List Handling
  690.                   -    insert, delete, and replace items in a list
  691.                   -    sort and search a string, integer, or real list
  692.                   -    view a string list using the internal browser
  693.              + String Handling
  694.                   -    full C library string scanning and manipulation
  695.                   -    a  full  featured line  editor  for  flexible data
  696.                        entry
  697.              + Entity Creation
  698.                   -    fast basic entity creation  in one statement using
  699.                        entmake    + Utility / Misc
  700.                   -    sound routines
  701.                   -    dump a list for debugging
  702.                   -    run other programs under program control
  703.                   -    clock and timer routines
  704.  
  705.         *    an ASCII file browser (like the shareware program LIST)
  706.  
  707.         *    ELFDOS  - "DOS-like"  file management  commands from  within
  708.              AutoCAD,  no more  shelling out  to copy  a file  or perform
  709.              other DOS functions.
  710.  
  711.         *    Three   useful  "ELFapps"  that   utilize  the  ELF  library
  712.              including:    
  713.  
  714.              +    NotePad -  a windowed /  full screen ASCII  file editor
  715.                   written in AutoLISP using ELF
  716.              +    Etables - an  AutoCAD "stock"  application modified  to
  717.                   utilize the ELF menus and symbol browser to display all
  718.                   tables within a drawing.
  719.              +    Demo - a program the demonstrates many of the functions
  720.                   of the ELF library
  721.  
  722.  
  723.         Elf Documentation                                          Page 3
  724.  
  725.  
  726.         Installation
  727.  
  728.         Copy the  ELF files  from the  distribution diskette  (or extract
  729.         them from  the archive file)  to any subdirectory on  the AutoCAD
  730.         library  path.  You  may  place   the  ELF  files  in  their  own
  731.         subdirectory (eg C:\ELF)  and add that directory to  your AutoCAD
  732.         Library Path. To insure that AutoCAD can the find files,  add the
  733.         ELF  directory  to   your  ACAD  environment  variable   in  your
  734.         AUTOEXEC.BAT or ACAD386.BAT file:
  735.  
  736.         Example:
  737.  
  738.         SET ACAD=C:\ACAD386\SUPPORT;C:\ELF
  739.  
  740.  
  741.         ACAD.ADS
  742.  
  743.         If you have an  ACAD.ADS file, then add ELF to that  file with an
  744.         ASCII editor, or create  a file named ACAD.ADS to  a directory on
  745.         the library path.
  746.  
  747.         Example contents release 12 ACAD.ADS file:
  748.  
  749.         ACADAPP
  750.         ELF
  751.  
  752.         If ELF  does not load with your ACAD.ADS  file then you must load
  753.         it manually:
  754.  
  755.         eg: (XLOAD"ELF")
  756.  
  757.         Once  loaded, ELF  will  display the  following message,  and ELF
  758.         commands and functions will be available for use:
  759.  
  760.         ELF vX.XX - <compile date>, Registered to: Your Name
  761.         Copyright 1992 Mountain Software. - Enter "ELF" for help:
  762.  
  763.         You may add the following code to any AutoLISP program which uses
  764.         ELF to automatically xload ELF.EXP:
  765.  
  766.         (if(not(member(findfile "ELF.EXP") (ADS)))
  767.           (if(not(xload"ELF" nil)) (progn
  768.             (princ "\nERROR: Unable to xload ELF.EXP")
  769.             (princ\nThis program requires ELF to operate!\007")))
  770.         )
  771.  
  772.         or you can simply add (load"ELF") to your program to load ELF.EXP
  773.         and define color and key symbols.
  774.  
  775.  
  776.         Elf Documentation                                          Page 4
  777.  
  778.  
  779.         ACAD.LSP
  780.  
  781.         ELF functions can not be  executed until ELF initializes. AutoCAD
  782.         does not initialize ADS programs until  after ACAD.LSP loads. You
  783.         can  include ELF  functions  in  any function  that  you wish  to
  784.         (defun) in ACAD.LSP, but they can not execute during the load.
  785.  
  786.         Therefore, if you wish to execute an ELF function at entry to the
  787.         drawing  editor, you can  place that  function into  the function
  788.         (S::STARTUP)  which  will  execute  automatically  after  AutoCAD
  789.         initialized ELF.
  790.  
  791.  
  792.         Sample Programs
  793.  
  794.         The  following files contain  "ELFapps" that demonstrate  many of
  795.         the  ELF functions.  You may  run  these programs  to test  ELF's
  796.         features  and  copy portions  of  the code  for  use in  your own
  797.         programs.
  798.  
  799.  
  800.         Filename       Description
  801.  
  802.         DEMO.LSP       A demonstration of many of ELF's functions
  803.         NOTEPAD.LSP    An ASCII file editor written in AutoLISP and ELF.
  804.         ETABLES.LSP    A  program   which  demonstrates  how   a  "stock"
  805.                        AutoLISP  program   (here  TABLES.LSP,   a  sample
  806.                        program included with other  AutoCAD sample files)
  807.                        can  be easily  modified using functions  from ELF
  808.                        and greatly improved from it's original form.
  809.         ELF.LSP        defines  symbols  for  screen  attributes,  border
  810.                        types,  keycode values, and  xloads ELF.EXP if not
  811.                        already loaded.
  812.  
  813.  
  814.         Elf Documentation                                          Page 5
  815.  
  816.  
  817.  
  818.         ELFDOS Commands
  819.  
  820.         ELF  contains many file  manipulation commands equivalent  to the
  821.         same commands in DOS. Many of  the command names are the same  as
  822.         the DOS command except that the letter "D" is added as  the first
  823.         letter  of  the  command to  differentiate  from  similarly named
  824.         AutoCAD command (eg DCOPY for COPY).
  825.  
  826.         Why not just shell to DOS?
  827.  
  828.         The  ELF  replacements  for  DOS commands  are  faster  and  more
  829.         convenient. It takes time  to shell to  DOS and return after  the
  830.         command has completed.
  831.  
  832.         ELF  also adds  ASCII file  and  AutoLISP symbol  viewers, and  a
  833.         filefind command.
  834.  
  835.                      ----------------------------------------
  836.  
  837.         Function:   cd                                       ELF Commands
  838.  
  839.         Synopsis:   change directories
  840.         Aliases:    chdir, dcd
  841.         Arguments:  directory name
  842.         Notes:      works just like the DOS chdir command except a space
  843.                     or Enter is required between CD and the directory
  844.                     name
  845.         Example:    CD \ACAD
  846.  
  847.                      ----------------------------------------
  848.  
  849.         Function:   cls                                      ELF Commands
  850.  
  851.         Synopsis:   clear (erase) the text screen
  852.         Aliases:
  853.         Arguments:
  854.         Notes:
  855.         Example:
  856.  
  857.                      ----------------------------------------
  858.  
  859.         Function:   c:                                       ELF Commands
  860.  
  861.         Synopsis:   logs to C: drive
  862.         Aliases:
  863.         Arguments:
  864.  
  865.  
  866.         Elf Documentation                                          Page 6
  867.  
  868.  
  869.         Notes:      Similar to DOS, ELF creates a command for each valid
  870.                     disk drive, therefore, if drives A:,B:,C:, and D: are
  871.                     valid drives, then any of those drives can be logged
  872.                     by entering its drive letter and a colon. Elf will
  873.                     not log to a drive that is not ready (eg floppy drive
  874.                     door open)
  875.         Example:
  876.  
  877.                      ----------------------------------------
  878.  
  879.         Function:   dcopy                                    ELF Commands
  880.  
  881.         Synopsis:   copy DOS file(s)
  882.         Aliases:
  883.         Arguments:  from      filespec to copy from (can be a wildcard)
  884.                     to        filename or directory to copy to
  885.         Notes:      dcopy performs a "double buffered" (eg fast) file
  886.                     copy and prints from and to filenames as they are
  887.                     copied
  888.         Example:    dcopy c:\acad\*.doc d:\temp
  889.  
  890.                      ----------------------------------------
  891.  
  892.         Function:   derase                                   ELF Commands
  893.  
  894.         Synopsis:   erase / delete DOS file(s)
  895.         Aliases:    ddel
  896.         Arguments:  filespec  filespec to erase (can be a wildcard)
  897.         Notes:      prints filenames as they are deleted
  898.         Example:    derase c:\acad\*.bak
  899.  
  900.                      ----------------------------------------
  901.  
  902.         Function:   dir                                      ELF Commands
  903.  
  904.         Synopsis:   prints a file directory list
  905.         Aliases:    ddir
  906.         Arguments:  filespec  optional wildcard filespec (eg *.DWG)
  907.                     /W        optional switch, prints wide (five
  908.                               filenames per line)
  909.         Notes:
  910.         Example:    ddir *.doc
  911.  
  912.                      ----------------------------------------
  913.  
  914.         Function:   drename                                  ELF Commands
  915.  
  916.         Synopsis:   rename / move file(s)
  917.         Aliases:    dmove
  918.         Arguments:  from      filespec to move from (can be a wildcard)
  919.                     to        filename or directory to move to
  920.  
  921.  
  922.         Elf Documentation                                          Page 7
  923.  
  924.  
  925.         Notes:      destination must be the same device
  926.         Example:    dmove c:\acad\*.doc c:\temp
  927.  
  928.                      ----------------------------------------
  929.  
  930.         Function:   elf                                      ELF Commands
  931.  
  932.         Synopsis:   displays a list of all ELF commands and functions
  933.         Aliases:
  934.         Arguments:
  935.         Notes:      uses the ELF browser to display help for all ELF
  936.                     commands and functions (see look).
  937.         Example:
  938.  
  939.                      ----------------------------------------
  940.  
  941.         Function:   ff                                       ELF Commands
  942.  
  943.         Synopsis:   find file(s) on the AutoCAD library path and DOS path
  944.         Aliases:
  945.         Arguments:
  946.         Notes:      searches for file(s) in the following sequence:
  947.                     1 -       The current directory, the real current
  948.                               directory, which may not be on the AutoCAD
  949.                               library path if you have changed
  950.                               directories after starting AutoCAD.
  951.                     2 -       the AutoCAD library path using AutoCAD's
  952.                               (findfile) function.
  953.                     3 -       the DOS path
  954.         Example:    ff *.sty
  955.  
  956.                      ----------------------------------------
  957.  
  958.         Function:   look                                     ELF Commands
  959.  
  960.         Synopsis:   display ASCII file(s) to the screen using the ELF
  961.                     browser
  962.         Aliases:
  963.         Arguments:  filespec  file(s) to display
  964.  
  965.  
  966.         Elf Documentation                                          Page 8
  967.  
  968.  
  969.         Notes:      look loads each file matching the filespec into a
  970.                     memory buffer and displays each using the internal
  971.                     full screen browser. The cursor keys can be used to
  972.                     view the file contents. The file can also be printed.
  973.                     If no filename is specified, look will call
  974.                     (wgetfile) where the user can select a file. Key
  975.                     assignments in the browser are as follows:
  976.                     Key       Function        
  977.                     F1        Help
  978.                     F2        text search (case insensitive)
  979.                     Esc       Quit all files
  980.                     Q/X/E     Quit / Exit file
  981.                     Alt-P     print the entire contents of the buffer to
  982.                               PRN
  983.                     Home      Top of file
  984.                     End       Bottom of file
  985.                     Up        Up one line
  986.                     Dn        Down one line
  987.                     PgUp      Up one page
  988.                     PgDn and
  989.                     other keys  Down one page
  990.         Example:    look c:\acad\*.doc
  991.  
  992.                      ----------------------------------------
  993.  
  994.         Function:   mkdir                                    ELF Commands
  995.  
  996.         Synopsis:   create a directory
  997.         Aliases:    md, dmd
  998.         Arguments:  directory name
  999.         Notes:
  1000.         Example:    MD C:\ACAD\TEMPDIR
  1001.  
  1002.                      ----------------------------------------
  1003.  
  1004.         Function:   password                                 ELF Commands
  1005.  
  1006.         Synopsis:   register ELF with your password (obtain from Mountain
  1007.                     Software)
  1008.         Aliases:
  1009.         Arguments:
  1010.         Notes:      Once the elf password is entered, the delay messages
  1011.                     will not appear. Passwords are provided to those who
  1012.                     purchase ELF.
  1013.         Example:
  1014.  
  1015.                      ----------------------------------------
  1016.  
  1017.         Function:   rmdir                                    ELF Commands
  1018.  
  1019.         Synopsis:   remove (delete) a directory
  1020.         Aliases:    rd, drd
  1021.         Arguments:
  1022.  
  1023.  
  1024.         Elf Documentation                                          Page 9
  1025.  
  1026.  
  1027.         Notes:      the directory must be empty
  1028.         Example:    RD C:\ACAD\TEMPDIR
  1029.  
  1030.                      ----------------------------------------
  1031.  
  1032.         Function:   sd                                       ELF Commands
  1033.  
  1034.         Synopsis:   set default disk drive
  1035.         Aliases:    dsd
  1036.         Arguments:
  1037.         Notes:      ELF also defines all valid drives as commands (eg A:,
  1038.                     B:, C:, D:, etc).
  1039.         Example:
  1040.  
  1041.                      ----------------------------------------
  1042.  
  1043.         Function:   symbol                                   ELF Commands
  1044.  
  1045.         Synopsis:   displays the value of an AutoLISP symbol
  1046.         Aliases:
  1047.         Arguments:  sym       symbol name
  1048.         Notes:      (release 12 only) Symbol name can not be an AutoLISP
  1049.                     expression. Symbols of type Subr or Exsubr can not be
  1050.                     displayed. See the command "look" for a description
  1051.                     of the ELF browser.
  1052.         Example:    (setq symlist (qsort(atoms-family 1)))
  1053.                     symbol symlist
  1054.  
  1055.                      ----------------------------------------
  1056.  
  1057.         Function:   ver                                      ELF Commands
  1058.  
  1059.         Synopsis:   prints ELF, DOS and AutoCAD version numbers
  1060.         Aliases:
  1061.         Arguments:
  1062.         Notes:
  1063.         Example:
  1064.  
  1065.                      ----------------------------------------
  1066.  
  1067.  
  1068.         Elf Documentation                                         Page 10
  1069.  
  1070.  
  1071.  
  1072.         AutoLISP Functions
  1073.  
  1074.         Optional Parameters
  1075.  
  1076.         The  ELF library  utilizes optional  parameters  for many  of its
  1077.         functions. Optional  parameters assume  a default  value when  no
  1078.         specific value  is specified in  the function call.  For example,
  1079.         the  ELF function  (beep) with  no parameters  will sound  the PC
  1080.         speaker at a  frequency of 440 hertz for 0.5  seconds by default.
  1081.         Or,  you  can specify  the  frequency  alone  (beep 800)  or  the
  1082.         frequency and time, (beep 800 1.0). You can not, however, specify
  1083.         the second parameter without specifying the first.
  1084.  
  1085.         Variable Parameters
  1086.  
  1087.         Some functions also  accept a variable number  of parameters. For
  1088.         example,  the  function  (printf format  ...)  requires  a format
  1089.         parameter, but  additional parameters  are required  only if  the
  1090.         format contains  variable  specifier.  (printf  "\nHello  World")
  1091.         requires  only the format  parameter but (printf  "Name: %10.10s,
  1092.         Age: %2d" name age) requires two  additional parameters to supply
  1093.         the required values.
  1094.  
  1095.         Data Types
  1096.  
  1097.         The following  pneumonics are  used to denote  data types  in ELF
  1098.         functions.
  1099.  
  1100.         Pneumonic Data Type       Description
  1101.         -------------------------------------------------------------
  1102.         <int>     integer         signed short Integer
  1103.         <real>    real            double precision float
  1104.         <str>     string          character string
  1105.         <char>    integer         a character ascii value
  1106.         <list>    list            AutoLISP list
  1107.         <slist>   string list     list of strings
  1108.         <fspec)   string          filespec string
  1109.         <path>    string          directory path
  1110.         <drive>   string          single character string drive letter
  1111.         <dir>     string          directory
  1112.         <fn>      string          file name
  1113.         <ext>     string          file extension
  1114.         <disk>    integer         integer disk number (A=1)
  1115.         <col>     integer         screen column (X) position
  1116.         <row>     integer         screen row (Y) position
  1117.         <attr>    integer         screen color attribute
  1118.         <pt>      point           a list of two or three reals
  1119.         <cen>     point           "
  1120.         <rad>     real            radius units
  1121.         <ang>     real            angle in radians
  1122.         <layer>   string          an AutoCAD layer
  1123.         <symbol>  symbol          an AutoLISP symbol (atom or list)
  1124.  
  1125.  
  1126.         ELF Functions                                             page 11
  1127.  
  1128.  
  1129.         Return Values
  1130.  
  1131.         ELF  functions can return any of the  primary data types (eg int,
  1132.         real, string, and nil) and lists.  AutoCAD 386 does not support a
  1133.         long integer data  type, therefore some ELF  functions that would
  1134.         return  a long  will  return a  real value.  The  function (rand)
  1135.         returns real values from a long integer result.
  1136.  
  1137.         Many functions return lists of values. The values of the list can
  1138.         be retrieved using (nth) as well as  (car), (cdr), and up to four
  1139.         levels of concatenations of (car) and (cadr) as follows:
  1140.  
  1141.         (nth 0 lst)    (car list)     ;first element
  1142.         (nth 1 lst)    (cadr list)    ;second element
  1143.         (nth 2 lst)    (caddr list)   ;third element
  1144.         (nth 3 lst)    (cadddr list)  ;fourth element
  1145.         (nth 4 lst)    (caddddr list) ;fifth element
  1146.         (nth 5 lst)                   ;fifth element, etc
  1147.  
  1148.         Many functions  that are converted  C functions  will return  nil
  1149.         instead of 0 to indicate a False  result. This allows testing for
  1150.         falsity in one step. For example:
  1151.  
  1152.         (if(isascii ch)(doit)) 
  1153.  
  1154.         is much simpler than:
  1155.  
  1156.         (if(/= 0 (isascii ch))(doit))
  1157.  
  1158.  
  1159.         Video Functions
  1160.  
  1161.         The ELF  video  system  is  a collection  of  fast  and  flexible
  1162.         functions  that write  directly to the  text screen  video screen
  1163.         buffer.
  1164.  
  1165.         The function printf, from of the C function  library, is included
  1166.         in  two forms.  The  first, (printf)  uses  the AutoCAD  internal
  1167.         printf  function. Text printed with this function will "stick" if
  1168.         the user  presses <F1> to  flipscreen to the  graphics screen and
  1169.         back to the text screen. AutoCAD uses it's own text screen buffer
  1170.         to save the screen on a single monitor setup. 
  1171.  
  1172.         The function  (scr_printf), as well  as many of  the other screen
  1173.         write functions, writes directly to the video buffer,  and is not
  1174.         saved  to AutoCAD's internal buffer. It  is much faster, but will
  1175.         disappear  when the user flips screen  to the graphics screen and
  1176.         then returns to the text screen. (scr_printf) also prints using a
  1177.         color attribute. 
  1178.  
  1179.         The  color attribute is set with  the (set_color) function or, in
  1180.         release 12 the  symbol "color" can be  set to the  selected color
  1181.         attribute. The internal color variable is also used  by the other
  1182.  
  1183.  
  1184.         ELF Functions                                             page 12
  1185.  
  1186.  
  1187.         screen write functions if no color attribute is  specified in the
  1188.         optional  attribute  function  parameter.  The  file   COLORS.LSP
  1189.         contains symbolic  names  for the  color  attributes and  can  be
  1190.         loaded within any AutoLISP program to define the color symbols.
  1191.  
  1192.                      ----------------------------------------
  1193.  
  1194.         Function:   box                                             Video
  1195.  
  1196.         Synopsis:   draws a box (rectangle) on the text screen using
  1197.                     graphic ascii characters.
  1198.         Prototype:  (box col row ecol erow attr btype)
  1199.         Arguments:  <int>     col  upper left corner column position
  1200.                     <int>     row  upper left corner row position
  1201.                     <int>     ecol                lower right corner
  1202.                                                   column position
  1203.                     <int>     erow                lower right corner row
  1204.                                                   position
  1205.                     <int>     attr                optional color
  1206.                                                   attribute [default
  1207.                                                   color symbol]
  1208.                     <int>     btype               optional border type
  1209.                                                   [default single line]
  1210.         Returns:    none
  1211.         Notes:      does not erase the area inside the box
  1212.         Example:    (box 10 2 70 18 23 1)
  1213.  
  1214.                      ----------------------------------------
  1215.  
  1216.         Function:   cls                                             Video
  1217.  
  1218.         Synopsis:   clear text screen to optional color attribute
  1219.         Prototype:  (cls attr)
  1220.         Arguments:  <int>     attr                optional color
  1221.                                                   attribute
  1222.         Returns:    none
  1223.         Notes:
  1224.         Example:    (cls 23) ;;; clear screen using light grey on blue
  1225.                     attribute
  1226.  
  1227.                      ----------------------------------------
  1228.  
  1229.         Function:   get_video                                       Video
  1230.  
  1231.         Synopsis:   get current text screen video parameters
  1232.         Prototype:  (get_video)
  1233.         Arguments:  none
  1234.  
  1235.  
  1236.         ELF Functions                                             page 13
  1237.  
  1238.  
  1239.         Returns:    <list>
  1240.                     cols      <int>               width of text screen
  1241.                                                   (usually 80)
  1242.                     rows      <int>               height of text screen
  1243.                                                   (usually 25)
  1244.                     mode      <int>               video mode
  1245.                     page      <int>               video page
  1246.         Notes:
  1247.         Example:    (setq vid      (get_video)
  1248.                               cols                (car vid)
  1249.                               rows                (cadr vid))
  1250.  
  1251.                      ----------------------------------------
  1252.  
  1253.         Function:   printf                                          Video
  1254.  
  1255.         Synopsis:   formatted "C" type print to text screen or graphics
  1256.                     command prompt area
  1257.         Prototype:  (printf format ...)
  1258.         Arguments:  format    <string>            conversion
  1259.                                                   specification string
  1260.         Returns:    ...                           a <string>, <int> or
  1261.                                                   <float> arguments for
  1262.                                                   each format specifier
  1263.                                                   in the format parameter
  1264.         Notes:      see a "C" language text or compiler library
  1265.                     documentation
  1266.         Example:    (printf "%-10s%10.2f  %d" strvar floatvar intvar)
  1267.  
  1268.                      ----------------------------------------
  1269.  
  1270.         Function:   prts                                            Video
  1271.  
  1272.         Synopsis:   fast write to text screen at col, row position with
  1273.                     optional attribute
  1274.         Prototype:  (prts col row string attr)
  1275.         Arguments:  col       <int>               screen column position
  1276.                     row       <int>               screen row position
  1277.                     string    <str>               text string
  1278.                     attr      <int>               optional color
  1279.                                                   attribute
  1280.         Returns:    none
  1281.         Notes:      uses direct video buffer write for speed
  1282.         Example:    (prts 40 10 "Hello World" 23)
  1283.  
  1284.                      ----------------------------------------
  1285.  
  1286.         Function:   puts                                            Video
  1287.  
  1288.         Synopsis:   fast write to text screen at cursor position with
  1289.                     optional attribute
  1290.         Prototype:  (puts string attr)
  1291.  
  1292.  
  1293.         ELF Functions                                             page 14
  1294.  
  1295.  
  1296.         Arguments:  string    <str>               text string
  1297.                     attr      <int>               optional color
  1298.                                                   attribute
  1299.         Returns:    none
  1300.         Notes:      uses direct video buffer write for speed
  1301.         Example:    (puts "Hello World" 23)
  1302.  
  1303.                      ----------------------------------------
  1304.  
  1305.         Function:   restore_screen                                  Video
  1306.  
  1307.         Synopsis:   restores a previously captured text screen
  1308.         Prototype:  (restore_screen)
  1309.         Arguments:  none
  1310.         Returns:    1 if successful, nil otherwise
  1311.         Notes:      the cursor position and size are not restored (use
  1312.                     get_cursor/set_cursor)
  1313.         Example:    see save_screen
  1314.  
  1315.                      ----------------------------------------
  1316.  
  1317.         Function:   save_screen                                     Video
  1318.  
  1319.         Synopsis:   captures the contents of the text screen to a memory
  1320.                     buffer
  1321.         Prototype:  (save_screen)
  1322.         Arguments:  none
  1323.         Returns:    1 if successful, nil otherwise
  1324.         Notes:      only one buffer is allocated, subsequent use will
  1325.                     overwrite any previous contents of the buffer
  1326.         Example:    (save_screen)                 ;;; take a picture of
  1327.                                                   the screen
  1328.                     ;;; do something that messes up the screen
  1329.                     (restore_screen)              ;;; put it back the way
  1330.                                                   that it was
  1331.  
  1332.                      ----------------------------------------
  1333.  
  1334.         Function:   scr_fill                                        Video
  1335.  
  1336.         Synopsis:   fill a rectangle of the text screen with a character
  1337.                     and color attribute
  1338.         Prototype:  (scr_fill col row cols rows ch attr)
  1339.         Arguments:  col       <int>               upper left column
  1340.                                                   position
  1341.                     row       <int>               upper left row position
  1342.                     cols      <int>               lower right column
  1343.                                                   position
  1344.                     rows      <int>               lower right row
  1345.                                                   position
  1346.                     ch        <int>               character as an integer
  1347.                     attr      <int>               color attribute
  1348.         Returns:    none
  1349.  
  1350.  
  1351.         ELF Functions                                             page 15
  1352.  
  1353.  
  1354.         Notes:
  1355.         Example:    (setq vid (get_video) vcols (car vid) vrows (cadr
  1356.                     vid))
  1357.                     (scr_fill 0 0 vcols vrows (ascii "░") 23) ;;;
  1358.                               fill entire screen with patterned
  1359.                               lightgrey on blue
  1360.  
  1361.                      ----------------------------------------
  1362.  
  1363.         Function:   scr_printf                                      Video
  1364.  
  1365.         Synopsis:   formatted "C" type print to text screen using direct
  1366.                     video buffer write
  1367.         Prototype:  (scr_printf format ...)
  1368.         Arguments:  format    <string>            conversion
  1369.                                                   specification string
  1370.         Returns:    ...                           any number of <string>,
  1371.                                                   <int> or <float>
  1372.                                                   arguments
  1373.         Notes:      see a "C" language text or compiler library
  1374.                     documentation
  1375.         Example:    see printf
  1376.  
  1377.                      ----------------------------------------
  1378.  
  1379.         Function:   set_color                                       Video
  1380.  
  1381.         Synopsis:   sets the internal "color" variable for use by
  1382.                     subsequent uses of routines which can use the default
  1383.                     color (r11)
  1384.         Prototype:  (set_color attr)
  1385.         Arguments:  attr      <int>               color attribute
  1386.         Returns:    for release 12 the AutoLISP symbol COLOR is used to
  1387.                     set the default color
  1388.         Notes:      (set_color 23)
  1389.         Example:
  1390.  
  1391.                      ----------------------------------------
  1392.  
  1393.         Cursor Functions
  1394.  
  1395.         The cursor functions provide a means to control  the location and
  1396.         appearance of  the screen  cursor.  Several of  the video  screen
  1397.         write  functions print at the cursor location, (gotoxy) positions
  1398.         the  cursor  and  (getxy) returns  the  current  cursor location.
  1399.         (get_cursor) returns the  cursor shape and (set_cursor)  sets the
  1400.         cursor shape  (start and ending  scan lines).  (set_cursor 32  0)
  1401.         will also hide the cursor.
  1402.  
  1403.                      ----------------------------------------
  1404.  
  1405.  
  1406.         ELF Functions                                             page 16
  1407.  
  1408.  
  1409.         Function:   get_cursor                                     Cursor
  1410.  
  1411.         Synopsis:   get cursor size / shape
  1412.         Prototype:  (get_cursor)
  1413.         Arguments:
  1414.         Returns:    <list>
  1415.                     start     <int>               start scan line
  1416.                     end       <int>               end scan line
  1417.         Notes:
  1418.         Example:    (setq save_cur (get_cursor)) ;;; save cursor shape
  1419.  
  1420.                      ----------------------------------------
  1421.  
  1422.         Function:   getxy                                          Cursor
  1423.  
  1424.         Synopsis:   get cursor screen coordinates
  1425.         Prototype:  (getxy)
  1426.         Arguments:
  1427.         Returns:    <list>
  1428.                     col       <int>               screen column position
  1429.                     row       <int>               screen row position
  1430.         Notes:
  1431.         Example:    (setq pos (getxy) col (car pos) row (cadr pos))
  1432.  
  1433.                      ----------------------------------------
  1434.  
  1435.         Function:   gotoxy                                         Cursor
  1436.  
  1437.         Synopsis:   position the screen cursor
  1438.         Prototype:  (gotoxy col row)
  1439.         Arguments:  col       <int>               screen column (x)
  1440.                                                   position
  1441.                     row       <int>               screen row (y) position
  1442.         Returns:
  1443.         Notes:
  1444.         Example:    (gotoxy 0 0) ;;; home cursor
  1445.  
  1446.                      ----------------------------------------
  1447.  
  1448.         Function:   set_cursor                                     Cursor
  1449.  
  1450.         Synopsis:   set cursor size; start to end scan lines
  1451.         Prototype:  (set_cursor start end)
  1452.         Arguments:  start     <int>               start scan line
  1453.                     end       <int>               end scan line
  1454.         Returns:
  1455.  
  1456.  
  1457.         ELF Functions                                             page 17
  1458.  
  1459.  
  1460.         Notes:      full cursor size is different depending on video
  1461.                     mode, the CGA cursor is 8 scan lines high, the
  1462.                     monochrome ,EGA, and VGA cursors are 14 scan lines
  1463.                     high. Specifying 32 as the start scan line will hide
  1464.                     the cursor.
  1465.         Example:    (set_cursor 0 13)  ;;; full block cursor
  1466.                     (set_cursor 12 13) ;;; normal cursor
  1467.                     (set_cursor 32 0)  ;;; hide cursor
  1468.  
  1469.                      ----------------------------------------
  1470.  
  1471.         Window Functions
  1472.  
  1473.         The ELF text screen window system rivals many commercial compiled
  1474.         language  function libraries. It provides the programmer with the
  1475.         tools  to  produce a  professional  "look and  feel"  to AutoLISP
  1476.         programs.
  1477.  
  1478.         When a window is opened, the screen text under the window and its
  1479.         border and shadow are saved. When the window is closed the screen
  1480.         is restored to its previous state. There is no practical limit to
  1481.         the number of windows open at on time.
  1482.  
  1483.         Only  the topmost  window  can be  written  to  using the  window
  1484.         writing routines (eg wputs,  wprts, etc). If you wish to write to
  1485.         a window other  than the topmost window,  you can do so,  but you
  1486.         must  use the screen writing routines, calculate cursor position,
  1487.         and otherwise maintain the window yourself.
  1488.  
  1489.         When no color attribute is specified in a  window write function,
  1490.         the window  attribute will  be used  by default,  not the  symbol
  1491.         "color" as used by screen writing functions.
  1492.  
  1493.                      ----------------------------------------
  1494.  
  1495.         Function:   set_menu_help                                  Window
  1496.  
  1497.         Synopsis:   sets the user help string list for wmenu
  1498.         Prototype:  (set_menu_help <slist>)
  1499.         Arguments:  <slist>   a string list to be displayed when the F1
  1500.                               key is pressed while in (wmenu). The first
  1501.                               item in the list will be the help window
  1502.                               title.
  1503.         Returns:
  1504.  
  1505.  
  1506.         ELF Functions                                             page 18
  1507.  
  1508.  
  1509.         Notes:      In release 12 or higher the symbol MENU_HELP can be
  1510.                     used to set the help string. In release 12
  1511.                     (set_menu_help) will also set this symbol. The symbol
  1512.                     MENU_HELP can be local to a particular function or
  1513.                     global in scope.
  1514.  
  1515.                     The user can display the default help screen by
  1516.                     pressing F1 the second time.
  1517.         Example:    (set_menu_help '("[ My Help Screen ]" "" "This is my
  1518.                     help message"))
  1519.  
  1520.                      ----------------------------------------
  1521.  
  1522.         Function:   wclose                                         Window
  1523.  
  1524.         Synopsis:   closes the top window restoring the screen under the
  1525.                     window
  1526.         Prototype:  (wclose)
  1527.         Arguments:  none
  1528.         Returns:    number of remaining open windows if successful or nil
  1529.         Notes:
  1530.         Example:
  1531.  
  1532.                      ----------------------------------------
  1533.  
  1534.         Function:   wcloseall                                      Window
  1535.  
  1536.         Synopsis:   closes all windows
  1537.         Prototype:  (wcloseall)
  1538.         Arguments:  none
  1539.         Returns:
  1540.         Notes:      use at the end of programs to close any remaining
  1541.                     open windows
  1542.         Example:
  1543.  
  1544.                      ----------------------------------------
  1545.  
  1546.         Function:   wclreol                                        Window
  1547.  
  1548.         Synopsis:   erase from window cursor to end of line
  1549.         Prototype:  (wclreol)
  1550.         Arguments:
  1551.         Returns:    none
  1552.         Notes:
  1553.         Example:
  1554.  
  1555.                      ----------------------------------------
  1556.  
  1557.         Function:   wcls                                           Window
  1558.  
  1559.         Synopsis:   clear window to optional color attribute
  1560.         Prototype:  (wcls attr)
  1561.  
  1562.  
  1563.         ELF Functions                                             page 19
  1564.  
  1565.  
  1566.         Arguments:  <int>     attr                optional color
  1567.                                                   attribute
  1568.         Returns:    none
  1569.         Notes:
  1570.         Example:    (wcls 23) ;;; clear window using light grey on blue
  1571.                     attribute
  1572.  
  1573.                      ----------------------------------------
  1574.  
  1575.         Function:   werase_line                                    Window
  1576.  
  1577.         Synopsis:   erase a line of text from a window
  1578.         Prototype:  (werase_line line)
  1579.         Arguments:  line      <int>               window row to erase
  1580.         Returns:    none
  1581.         Notes:
  1582.         Example:    (werase_line 2) ;;; erase line 2
  1583.  
  1584.                      ----------------------------------------
  1585.  
  1586.         Function:   wgetstr                                        Window
  1587.  
  1588.         Synopsis:   open a window centered on the text screen, prints a
  1589.                     prompt on the top border and gets string input.
  1590.         Prototype:  (wgetstr prompt default length wattr battr btype)
  1591.         Arguments:  prompt    <string>            prompt string
  1592.                     default   <string>            optional default string
  1593.                                                   / string to edit
  1594.                     len       <int>               optional string length
  1595.                                                   (default = 78)
  1596.                     wattr     <int>               optional window
  1597.                                                   attribute (default =
  1598.                                                   color symbol)
  1599.                     battr     <int>               optional border
  1600.                                                   attribute (optional =
  1601.                                                   wattr)
  1602.                     btype     <int>               optional border type
  1603.                                                   (default = double)
  1604.         Returns:    the edited string or nil if the string is empty
  1605.         Notes:      see strget and wpopup
  1606.         Example:    (wgetstr "Enter text" "Hello World" 60 23 23 33)
  1607.  
  1608.                      ----------------------------------------
  1609.  
  1610.         Function:   wgetdrive                                      Window
  1611.  
  1612.         Synopsis:   select a disk drive from a menu, all valid drives are
  1613.                     listed with their respective drive type (eg
  1614.                     removable/floppy, fixed, network, and redirected
  1615.                     devices)
  1616.         Prototype:  (wgetdrive col row wattr battr hattr btype)
  1617.  
  1618.  
  1619.         ELF Functions                                             page 20
  1620.  
  1621.  
  1622.         Arguments:  col       <int>               optional upper left
  1623.                                                   column position
  1624.                                                   (default = centered)
  1625.                     row       <int>               optional upper left row
  1626.                                                   position (default =
  1627.                                                   centered)
  1628.                     wattr     <int>               optional window
  1629.                                                   attribute (default =
  1630.                                                   color variable)
  1631.                     battr     <int>               optional border
  1632.                                                   attribute
  1633.                     hattr     <int>               optional highlight
  1634.                                                   (cursor) bar attribute
  1635.                     btype     <int>               optional border type
  1636.         Returns:    the disk drive as an integer (A:=1, B:=2, etc)
  1637.         Notes:
  1638.         Example:    (setq drive (wgetdrive 10 5))
  1639.  
  1640.                      ----------------------------------------
  1641.  
  1642.         Function:   wgetfile                                       Window
  1643.  
  1644.         Synopsis:   select a file from a menu of DOS files from the
  1645.                     current directory. The user can change directories
  1646.                     and access all available disk drives.
  1647.         Prototype:  (wgetfile filespec fileattr col row wattr battr hattr
  1648.                     btype)
  1649.         Arguments:  filespec  <string>            wildcard filespec (eq
  1650.                                                   *.DAT)
  1651.                     fileattr  <int>               file attribute mask
  1652.                                                   (see findfirst)
  1653.                     col       <int>               optional upper left
  1654.                                                   column position
  1655.                                                   (default = -1 centered)
  1656.                     row       <int>               optional upper left row
  1657.                                                   position (default = -1
  1658.                                                   centered)
  1659.                     wattr     <int>               optional window
  1660.                                                   attribute (default =
  1661.                                                   color variable)
  1662.                     battr     <int>               optional border
  1663.                                                   attribute
  1664.                     hattr     <int>               optional highlight
  1665.                                                   (cursor) bar attribute
  1666.                     btype     <int>               optional border type
  1667.         Returns:    the full qualified pathname of the selected file or
  1668.                     nil if <Esc> is pressed.
  1669.         Notes:      The drive select menu is activated by pressing <Alt-
  1670.                     D>.
  1671.         Example:    (setq filename (wgetfile "*.TXT" 33 -1 -1 23 23 70
  1672.                     17)
  1673.  
  1674.                      ----------------------------------------
  1675.  
  1676.  
  1677.         ELF Functions                                             page 21
  1678.  
  1679.  
  1680.         Function:   wgetxy                                         Window
  1681.  
  1682.         Synopsis:   get window screen position
  1683.         Prototype:  (wgetxy)
  1684.         Arguments:  none
  1685.         Returns:    <list>
  1686.                     col       <int>               window column position
  1687.                     row       <int>               window row position
  1688.         Notes:
  1689.         Example:    (setq 
  1690.                       wcur (getxy)
  1691.                       wcol (car wcur)             ;;; cursor column
  1692.                       wrow (cadr wcur)            ;;; cursor row
  1693.                     )
  1694.  
  1695.                      ----------------------------------------
  1696.  
  1697.         Function:   wgotoxy                                        Window
  1698.  
  1699.         Synopsis:   move window cursor
  1700.         Prototype:  (wgotoxy col row)
  1701.         Arguments:  col       <int>               window column position
  1702.                     row       <int>               window row position
  1703.         Returns:    none
  1704.         Notes:
  1705.         Example:    (wgotoxy 0 0) ;;; home cursor in window
  1706.  
  1707.                      ----------------------------------------
  1708.  
  1709.         Function:   winfo                                          Window
  1710.  
  1711.         Synopsis:   gets the top window size and position
  1712.         Prototype:  (winfo)
  1713.         Arguments:  none
  1714.         Returns:    <list>
  1715.                     col       <int>               upper left column
  1716.                                                   position
  1717.                     row       <int>               upper left row position
  1718.                     cols      <int>               lower right column
  1719.                                                   position
  1720.                     rows      <int>               lower right row
  1721.                                                   position
  1722.         Notes:
  1723.         Example:    (setq     w    (winfo)
  1724.                               wcol                (car w)
  1725.                               wrow                (cadr w)
  1726.                               wcols               (caddr w)
  1727.                               wrows               (cadddr w))
  1728.  
  1729.                      ----------------------------------------
  1730.  
  1731.  
  1732.         ELF Functions                                             page 22
  1733.  
  1734.  
  1735.         Function:   wmenu                                          Window
  1736.  
  1737.         Synopsis:   opens a centered window and displays a menu. The user
  1738.                     can then select one of the displayed items.
  1739.         Prototype:  (wmenu slist wattr battr hattr btype shadow title)
  1740.         Arguments:  slist     <list>              list of strings to
  1741.                                                   display in the menu
  1742.                     col       <int>               optional upper left
  1743.                                                   column position
  1744.                                                   (default = centered)
  1745.                     row       <int>               optional upper left row
  1746.                                                   position (default =
  1747.                                                   centered)
  1748.                     wattr     <int>               optional window color
  1749.                                                   attribute (default =
  1750.                                                   "color" symbol)
  1751.                     battr     <int>               optional border
  1752.                                                   attribute (default =
  1753.                                                   wattr)
  1754.                     hattr     <int>               optional highlight bar
  1755.                                                   attribute (default =
  1756.                                                   reversed wattr)
  1757.                     btype     <int>               optional border type
  1758.                                                   (default = double line)
  1759.                     title     <string>            optional window title
  1760.         Returns:    <list>
  1761.                     <int>     0 based item number selected
  1762.                     <int>     keycode of key pressed to exit menu
  1763.  
  1764.  
  1765.         ELF Functions                                             page 23
  1766.  
  1767.  
  1768.         Notes:      If the list of items is longer that can be displayed
  1769.                     in one window then the user can page through the list
  1770.                     with the cursor keys. Keys are as follows:
  1771.                     Key       Meaning             
  1772.                     <Up>      move cursor up
  1773.                     <Down>    move cursor down
  1774.                     <PgUp>    move up one page
  1775.                     <PgDn>    move down one page
  1776.                     <Enter>   exit
  1777.                     <Ctrl-Enter>   exit
  1778.                     <Esc>     exit
  1779.                     <F1>      Display help screen. If the symbol
  1780.                               MENU_HELP is defined, its contents will be
  1781.                               displayed. The function (set_menu_help)
  1782.                               can be used to set MENU_HELP in release 10
  1783.                               or 11. The user can press F1 the second
  1784.                               time to display the default help text.
  1785.                     <End>     move to last item
  1786.                     <Home>    move to first item
  1787.                     <char>    any alphanumeric key will move the cursor
  1788.                               to the next item starting in that
  1789.                               character
  1790.         Example:    (setq 
  1791.                       item (wmenu '("Yes" "No") 23 23 1 1 "?"))
  1792.                       yn (car item)
  1793.                       key (cadr item)
  1794.                     )
  1795.                     (if(/= key EscKey) (doit) (exit))
  1796.  
  1797.                      ----------------------------------------
  1798.  
  1799.         Function:   wmsg                                           Window
  1800.  
  1801.         Synopsis:   opens a centered window, displays a message and
  1802.                     optionally waits for a keystroke and closes the
  1803.                     window
  1804.         Prototype:  (wmsg str wait attr battr btype)
  1805.         Arguments:  str       <string>            the message string
  1806.                     wait      <int>               optional, 1 = wait for
  1807.                                                   a keystroke then close
  1808.                                                   window (default) else
  1809.                                                   leave window open
  1810.                     wattr     <int>               optional window color
  1811.                                                   attribute (default =
  1812.                                                   color symbol)
  1813.                     wattr     <int>               optional border color
  1814.                                                   attribute (default =
  1815.                                                   wattr)
  1816.                     btype     <int>               optional border type
  1817.                                                   (default = double line
  1818.                                                   with drop shadow)
  1819.         Returns:    if wait=1 then keycode entered to close window is
  1820.                     returned
  1821.  
  1822.  
  1823.         ELF Functions                                             page 24
  1824.  
  1825.  
  1826.         Notes:
  1827.         Example:    (setq key (wmsg "Continue ?[Y/N]" 1 23 23 1))
  1828.  
  1829.                      ----------------------------------------
  1830.  
  1831.         Function:   wopen                                          Window
  1832.  
  1833.         Synopsis:   open a window on the text screen with specified
  1834.                     location, size, border, and colors; saving the area
  1835.                     under the window
  1836.         Prototype:  (wopen col row cols rows wattr battr btype)
  1837.         Arguments:  col       <int>               upper left column
  1838.                                                   position (-1 =
  1839.                                                   centered)
  1840.                     row       <int>               upper left row position
  1841.                                                   (-1 = centered)
  1842.                     cols      <int>               number of columns
  1843.                                                   (including border)
  1844.                     rows      <int>               number of rows
  1845.                                                   (including border)
  1846.                     wattr     <int>               optional window
  1847.                                                   attribute (default =
  1848.                                                   color variable)
  1849.                     battr     <int>               optional border
  1850.                                                   attribute
  1851.                     btype     <int>               optional border type:
  1852.                     Type      Meaning             
  1853.                     0         no border
  1854.                     1         single line
  1855.                     2         double line
  1856.                     3         double vertical
  1857.                     4         double horizontal
  1858.                     5         solid
  1859.                     btype + 8  = hilight upper left sides of border for
  1860.                     raised effect
  1861.                     btype + 16 = hilight lower right sides of border
  1862.                     btype + 32 = add drop shadow to right and lower sides
  1863.                     of window
  1864.  
  1865.         Returns:    <int>     the number of windows currently open
  1866.         Notes:      flips screen to the text screen
  1867.         Example:    (wopen 20 5 40 10 23 23 2)
  1868.  
  1869.                      ----------------------------------------
  1870.  
  1871.         Function:   wpopup                                         Window
  1872.  
  1873.         Synopsis:   open a window centered on the text screen
  1874.         Prototype:  (wpopup cols rows wattr battr)
  1875.  
  1876.  
  1877.         ELF Functions                                             page 25
  1878.  
  1879.  
  1880.         Arguments:  cols      <int>               number of column wide
  1881.                                                   (including border)
  1882.                     rows      <int>               number of rows high
  1883.                                                   (including border)
  1884.                     wattr     <int>               optional window
  1885.                                                   attribute (default =
  1886.                                                   color symbol)
  1887.                     battr     <int>               optional border
  1888.                                                   attribute (optional =
  1889.                                                   wattr)
  1890.                     btype     <int>               optional border type
  1891.                                                   (default = double)
  1892.         Returns:    the number of windows currently open
  1893.         Notes:
  1894.         Example:    (wpopup 40 10 23 23)
  1895.  
  1896.                      ----------------------------------------
  1897.  
  1898.         Function:   wprintf                                        Window
  1899.  
  1900.         Synopsis:   printf to window at window cursor position
  1901.         Prototype:  (wprintf format ...)
  1902.         Arguments:  see printf
  1903.         Returns:
  1904.         Notes:      see printf
  1905.         Example:
  1906.  
  1907.                      ----------------------------------------
  1908.  
  1909.         Function:   wprts                                          Window
  1910.  
  1911.         Synopsis:   write to window at col, row position with optional
  1912.                     attribute
  1913.         Prototype:  (wprts col row string attr)
  1914.         Arguments:  col       <int>               window column position
  1915.                     row       <int>               window row position
  1916.                     string    <str>               text string
  1917.                     attr      <int>               optional color
  1918.                                                   attribute
  1919.         Returns:    none
  1920.         Notes:
  1921.         Example:    (wprts 0 3 "Hello World" 23)
  1922.  
  1923.                      ----------------------------------------
  1924.  
  1925.         Function:   wputcen                                        Window
  1926.  
  1927.         Synopsis:   write a centered string to window at window cursor
  1928.                     row position
  1929.         Prototype:  (wputcen str)
  1930.         Arguments:  str       <string>            the string to print
  1931.         Returns:
  1932.  
  1933.  
  1934.         ELF Functions                                             page 26
  1935.  
  1936.  
  1937.         Notes:      cursor column position is ignored and the string is
  1938.                     centered within the window
  1939.         Example:
  1940.  
  1941.                      ----------------------------------------
  1942.  
  1943.         Function:   wputs                                          Window
  1944.  
  1945.         Synopsis:   write to window at window cursor position with
  1946.                     optional attribute
  1947.         Prototype:  (puts string attr)
  1948.         Arguments:  string    <str>               text string
  1949.                     attr      <int>               optional color
  1950.                                                   attribute
  1951.         Returns:    none
  1952.         Notes:
  1953.         Example:    (wputs "Hello World" 23)
  1954.  
  1955.                      ----------------------------------------
  1956.  
  1957.         Function:   wscroll                                        Window
  1958.  
  1959.         Synopsis:   scroll window text
  1960.         Prototype:  (wscroll dir start end lines)
  1961.         Arguments:  dir       <int>               direction; 0 = up
  1962.                                                   (default), 1 = down
  1963.                     start     <int>               start row to scroll
  1964.                                                   (default = 0)
  1965.                     end       <int>               end row  (default =
  1966.                                                   last window row)
  1967.                     line      <int>               optional number of
  1968.                                                   lines to scroll
  1969.                                                   (default = 1)
  1970.         Returns:    none
  1971.         Notes:
  1972.         Example:    (wscroll) ;;; scroll entire window up 1 line
  1973.                     (wscroll 1 0 2 1) ;;; scroll first 3 window rows up 1
  1974.                     line
  1975.  
  1976.  
  1977.                      ----------------------------------------
  1978.  
  1979.         Function:   wshadow                                        Window
  1980.  
  1981.         Synopsis:   adds a drop shadow to the top (last opened) window
  1982.         Prototype:  (wshadow attr)
  1983.         Arguments:  attr      <int>               color attribute
  1984.                                                   (default lightgrey on
  1985.                                                   black)
  1986.         Returns:
  1987.  
  1988.  
  1989.         ELF Functions                                             page 27
  1990.  
  1991.  
  1992.         Notes:
  1993.         Example:    (wshadow 23)
  1994.  
  1995.                      ----------------------------------------
  1996.  
  1997.         Function:   wtitle                                         Window
  1998.  
  1999.         Synopsis:   prints on the border of a window in one of 6
  2000.                     positions
  2001.         Prototype:  (wtitle <str> [<pos>])
  2002.         Arguments:  str       <string>            title message
  2003.                     pos       <int>               optional position to
  2004.                                                   place string
  2005.                     Value     Meaning             
  2006.                     0         top left (default)
  2007.                     1         top center
  2008.                     2         top right
  2009.                     3         bottom left
  2010.                     4         bottom center
  2011.                     5         bottom right
  2012.         Returns:
  2013.         Notes:      If no windows are open wtitle has no effect. Titles
  2014.                     will be trimmed to fit available space on the border.
  2015.         Example:    (wtitle "My Window" 1)
  2016.  
  2017.                      ----------------------------------------
  2018.  
  2019.         Keyboard Functions
  2020.  
  2021.         The ELF keyboard functions add both C library functions to read a
  2022.         character from the  keyboard and functions  to read the  keyboard
  2023.         directly. The function  (getkey) returns a unique  value for each
  2024.         key on  the PC keyboard.  The file  ELF.LSP contains symbols  for
  2025.         many (but not all)  of the PC function and control  keys. You can
  2026.         determine  the value  of  any key  by  entering  (getkey) at  the
  2027.         Command: prompt and then pressing the desired key.
  2028.  
  2029.         The  function (key_stuff)  provides  a  means  to  control  other
  2030.         programs when no other means exists to execute a command  or feed
  2031.         data to another command or program. The function is limited to 15
  2032.         characters unless  you have installed  a TSR keyboard  handler or
  2033.         driver which expands the size of the PC keyboard buffer.
  2034.  
  2035.                      ----------------------------------------
  2036.  
  2037.         Function:   getch                                             Key
  2038.  
  2039.         Synopsis:   get a character from the keyboard
  2040.         Prototype:  (getch)
  2041.         Arguments:
  2042.         Returns:    <int>     key character as an integer
  2043.  
  2044.  
  2045.         ELF Functions                                             page 28
  2046.  
  2047.  
  2048.         Notes:
  2049.         Example:    (setq char (chr(getch))) ;;; character as a string
  2050.  
  2051.                      ----------------------------------------
  2052.  
  2053.         Function:   getche                                            Key
  2054.  
  2055.         Synopsis:   get a character from the keyboard with echo
  2056.         Prototype:  (getche)
  2057.         Arguments:
  2058.         Returns:    <int>     key character as an integer
  2059.         Notes:      see getch
  2060.         Example:
  2061.  
  2062.                      ----------------------------------------
  2063.  
  2064.         Function:   getkey                                            Key
  2065.  
  2066.         Synopsis:   get a keystroke from the keyboard
  2067.         Prototype:  (getkey)
  2068.         Arguments:
  2069.         Returns:    <int>     keycode             The lower byte of
  2070.                                                   keycode contains the
  2071.                                                   key character and the
  2072.                                                   upper byte contains the
  2073.                                                   keyboard scancode.
  2074.         Notes:      The value returned by getkey is unique for (nearly)
  2075.                     every key on the PC keyboard. The file KEYS.LSP
  2076.                     contains a list of keycodes of cursor movement and
  2077.                     function keys. The keycode of any key can be
  2078.                     determined by executing (getkey) interactively.
  2079.         Example:    (setq 
  2080.                       c       (getkey)            ;;; the keycode
  2081.                       char    (chr(lobyte c))     ;;; key character as a
  2082.                                                   string
  2083.                       scode   (hibyte c)          ;;; keyboard scan code
  2084.                     )
  2085.  
  2086.                      ----------------------------------------
  2087.  
  2088.         Function:   kbhit                                             Key
  2089.  
  2090.         Synopsis:   checks the keyboard buffer for a waiting keystroke
  2091.         Prototype:  (kbhit)
  2092.         Arguments:
  2093.         Returns:    a non-zero value if a key is waiting
  2094.         Notes:
  2095.         Example:    (while (not(kbhit)))
  2096.  
  2097.                      ----------------------------------------
  2098.  
  2099.  
  2100.         ELF Functions                                             page 29
  2101.  
  2102.  
  2103.         Function:   key_clear                                         Key
  2104.  
  2105.         Synopsis:   clears the keyboard buffer of any pending keystrokes
  2106.         Prototype:  (key_clear)
  2107.         Arguments:
  2108.         Returns:
  2109.         Notes:
  2110.         Example:    (key_clear)    ;;; clear the keyboard
  2111.                     (setq key (getkey))           ;;; get a keystroke
  2112.  
  2113.                      ----------------------------------------
  2114.  
  2115.         Function:   key_ready                                         Key
  2116.  
  2117.         Synopsis:   returns immediately with a waiting key
  2118.         Prototype:  (key_ready)
  2119.         Arguments:
  2120.         Returns:    <int>     key                 or nil
  2121.         Notes:      key_ready checks the keyboard buffer and immediately
  2122.                     returns the next keycode (leaving it in the buffer)
  2123.                     or nil if no key is waiting
  2124.         Example:    (while (not(key_ready)))
  2125.  
  2126.                      ----------------------------------------
  2127.  
  2128.         Function:   key_stat                                          Key
  2129.  
  2130.         Synopsis:   gets the state of keyboard shift and other special
  2131.                     keys
  2132.         Prototype:  (key_stat)
  2133.         Arguments:
  2134.         Returns:    <int>     a bit coded field as follows:
  2135.                     Bit       Mask                Meaning
  2136.                                                   
  2137.                     0         1    Right shift key pressed
  2138.                     1         2    Left shift key presses
  2139.                     2         4    Ctrl key pressed
  2140.                     3         8    Alt key pressed
  2141.                     4         16   ScrollLock On
  2142.                     5         32   NumLock On
  2143.                     6         64   Capslock On
  2144.                     7         128  Insert On
  2145.         Notes:
  2146.         Example:
  2147.  
  2148.                      ----------------------------------------
  2149.  
  2150.         Function:   key_stuff                                         Key
  2151.  
  2152.         Synopsis:   "pushes" keys into the keyboard buffer
  2153.         Prototype:  (key_stuff str)
  2154.         Arguments:  str       <string>            up to 15 characters
  2155.         Returns:
  2156.  
  2157.  
  2158.         ELF Functions                                             page 30
  2159.  
  2160.  
  2161.         Notes:      stuffs the keyboard buffer to control "ill behaved"
  2162.                     programs. The DOS keyboard buffer can hold a maximum
  2163.                     of 15 keys, additional keys are ignored.
  2164.         Example:    (key_stuff ".QUIT\nY\n")
  2165.  
  2166.                      ----------------------------------------
  2167.  
  2168.         Directory Functions
  2169.  
  2170.         Elf contains a full suite of functions to read and manipulate the
  2171.         DOS file  directory system. In  addition to C  library functions,
  2172.         ELF  provides macro  functions  to return  a list  of  valid disk
  2173.         drives, directories, and files.
  2174.  
  2175.                      ----------------------------------------
  2176.  
  2177.         Function:   access                                      Directory
  2178.  
  2179.         Synopsis:   determines if a file exists and can be accessed by
  2180.                     mode
  2181.         Prototype:  (access path mode)
  2182.         Arguments:  <string> path
  2183.                     <int> mode:
  2184.                     Value     Test For            
  2185.                     0         existence only
  2186.                     1         read permission
  2187.                     2         write permission
  2188.                     3         read and write permission
  2189.         Returns:    1 if true, nil otherwise
  2190.         Notes:
  2191.         Example:    (access "C:\ACAD\FOO.DAT" 2)  ;;;checks for the
  2192.                                                   existence and write
  2193.                                                   permission
  2194.  
  2195.                      ----------------------------------------
  2196.  
  2197.         Function:   chdir                                       Directory
  2198.  
  2199.         Synopsis:   change disk directory
  2200.         Prototype:  (chdir path)
  2201.         Arguments:  path      <string>            DOS path
  2202.         Returns:    <string>  current directory after successful
  2203.                               execution or nil otherwise.
  2204.         Notes:      If a drive different from the current drive is
  2205.                     specified, the directory on the specified drive will
  2206.                     be changed. Does not log to a different drive.
  2207.         Example:    (chdir "\acad\dwgs")
  2208.  
  2209.                      ----------------------------------------
  2210.  
  2211.  
  2212.         ELF Functions                                             page 31
  2213.  
  2214.  
  2215.         Function:   chpath                                      Directory
  2216.  
  2217.         Synopsis:   change current disk drive and directory
  2218.         Prototype:  (chpath path)
  2219.         Arguments:  path      <string>            DOS path including
  2220.                                                   drive letter
  2221.         Returns:    <string> current directory after successful execution
  2222.                     or nil otherwise.
  2223.         Notes:
  2224.         Example:    (chpath "d:\dwgs")
  2225.  
  2226.                      ----------------------------------------
  2227.  
  2228.         Function:   disk_ready                                  Directory
  2229.  
  2230.         Synopsis:   verifies that a removable (floppy) drive is ready and
  2231.                     readable
  2232.         Prototype:  (disk_ready drive)
  2233.         Arguments:  drive     <int>               drive to check (1=A:,
  2234.                                                   2=B:, etc)
  2235.         Returns:    1 if true or nil otherwise
  2236.         Notes:
  2237.         Example:    (disk_ready 1) ;;; verify that drive A: is ready
  2238.  
  2239.                      ----------------------------------------
  2240.  
  2241.         Function:   disk_type                                   Directory
  2242.  
  2243.         Synopsis:
  2244.         Prototype:  (disk_type drive)
  2245.         Arguments:  drive     <int>               drive to check (1=A:,
  2246.                                                   2=B:, etc)
  2247.         Returns:    0         removable (floppy) disk
  2248.                     1         fixed (hard) disk
  2249.                     2         network drive
  2250.                     3         redirected device
  2251.                     nil       invalid drive
  2252.         Notes:
  2253.         Example:
  2254.  
  2255.                      ----------------------------------------
  2256.  
  2257.         Function:   disk_valid                                  Directory
  2258.  
  2259.         Synopsis:   verifies that a disk drive is a valid device (but not
  2260.                     necessarily ready if a removable/floppy drive)
  2261.         Prototype:  (disk_valid drive)
  2262.         Arguments:  drive     <int>               drive to check (1=A:,
  2263.                                                   2=B:, etc)
  2264.         Returns:    1 if true or nil otherwise
  2265.  
  2266.  
  2267.         ELF Functions                                             page 32
  2268.  
  2269.  
  2270.         Notes:
  2271.         Example:    (disk_valid 6) ;;; verify that drive F: is valid
  2272.  
  2273.                      ----------------------------------------
  2274.  
  2275.         Function:   erasefile                                   Directory
  2276.  
  2277.         Synopsis:   erase file(s)
  2278.         Prototype:  (erasefile filename)
  2279.         Arguments:  filename <string> - file to erase
  2280.         Returns:    1 - success
  2281.                     0 - fail
  2282.         Notes:
  2283.         Example:    (erasefile "thisfile.dat")
  2284.  
  2285.                      ----------------------------------------
  2286.  
  2287.         Function:   file_exists                                 Directory
  2288.  
  2289.         Synopsis:   determines if a file exists
  2290.         Prototype:  (file_exists path)
  2291.         Arguments:  <string> path
  2292.         Returns:    1 if true, nil otherwise
  2293.         Notes:
  2294.         Example:    (file_exists "C:\ACAD\FOO.DAT")
  2295.  
  2296.                      ----------------------------------------
  2297.  
  2298.         Function:   findfirst                                   Directory
  2299.  
  2300.         Synopsis:   finds the first instance of a file who's name and
  2301.                     directory attributes match the arguments.
  2302.         Prototype:  (findfirst filespec attribute)
  2303.  
  2304.  
  2305.         ELF Functions                                             page 33
  2306.  
  2307.  
  2308.         Arguments:  filespec <string>             optional - a filespec
  2309.                                                   which can include
  2310.                                                   wildcard characters in
  2311.                                                   the file specification
  2312.                                                   (default *.*)
  2313.                     attribute <integer>           optional - a value
  2314.                                                   between 0 and 255.
  2315.                                                   (default 33) The
  2316.                                                   following values can be
  2317.                                                   ORed or added to
  2318.                                                   produce the needed
  2319.                                                   attribute.
  2320.  
  2321.                     Value     Attribute           
  2322.                     1         Archive file
  2323.                     4         Hidden file
  2324.                     8         Normal file
  2325.                     16        Read only file
  2326.                     32        System file
  2327.                     64        Subdirectory
  2328.                     128       Volume ID
  2329.         Returns:    an AutoLISP list if successful or nil otherwise.
  2330.                     filename  <string> includes file extension
  2331.                     filesize  <string> size of the file in bytes.
  2332.                     date      <string> the file date
  2333.                     time      <string> the file time
  2334.                     attribute <int> the files' attribute
  2335.  
  2336.                     Example: ("FILENAME.EXT" "134562" "3/31/92" "11:21a"
  2337.                     9)
  2338.         Notes:      Findfirst allows you to use the * and ? wildcard
  2339.                     characters to search the file system directory
  2340.                     structure. If the file is found then the function
  2341.                     returns information about the file in an AutoLISP
  2342.                     list. If the attribute parameter is 255 then all
  2343.                     files and directories will match the attribute. The
  2344.                     combination of attribute = 255 and wildcard = "*.*"
  2345.                     will match all files, all directories, and the volume
  2346.                     id if it exists from the current subdirectory.
  2347.  
  2348.                     Files with no attributes will always be returned.
  2349.                     Therefore in order to retrieve only directories then
  2350.                     files with an attribute value of 0 must be filtered
  2351.                     out.
  2352.         Example:    (findfirst "*.DWG" 1+8+16)
  2353.  
  2354.                      ----------------------------------------
  2355.  
  2356.         Function:   findnext                                    Directory
  2357.  
  2358.         Synopsis:   finds the next occurrence of the file specification
  2359.                     and attribute after a findfirst call
  2360.         Prototype:  (findnext)
  2361.  
  2362.  
  2363.         ELF Functions                                             page 34
  2364.  
  2365.  
  2366.         Arguments:  none
  2367.         Returns:    AutoLISP list for the file. (see findfirst)
  2368.         Notes:
  2369.         Example:    (setq fn (findfirst 33 "*.DAT"))
  2370.                     (while (boundp 'fn))
  2371.                       (printf "\n%s" (car fn)))
  2372.                       (setq fn (findnext)
  2373.                     )
  2374.  
  2375.                      ----------------------------------------
  2376.  
  2377.         Function:   fullpath                                    Directory
  2378.  
  2379.         Synopsis:   expands a partial path into a full DOS path string
  2380.         Prototype:  (fullpath path)
  2381.         Arguments:  path <string> a relative or partial path string (eg
  2382.                     "c:filename.ext"
  2383.         Returns:    <string> the full path string (eg
  2384.                     "C:\ACAD\FILENAME.EXT")
  2385.         Notes:      the file does not have to exist
  2386.         Example:    (fullpath "D:FILE.DAT") ;;; might return
  2387.                     "D:\DIR1\FILE.DAT
  2388.  
  2389.                      ----------------------------------------
  2390.  
  2391.         Function:   getdir                                      Directory
  2392.  
  2393.         Synopsis:   returns a string with the current drive:\path
  2394.         Prototype:  (getdir)
  2395.         Arguments:  none
  2396.         Returns:    <string>  current directory path
  2397.         Notes:
  2398.         Example:    (setq curdir (getdir))
  2399.  
  2400.                      ----------------------------------------
  2401.  
  2402.         Function:   getdiskfree                                 Directory
  2403.  
  2404.         Synopsis:   returns size statistics in the specified drive number
  2405.                     as a list
  2406.         Prototype:  (getdiskfree 3)
  2407.         Arguments:  <int> drive number (Current=0, A=1, B=2, C=3, etc)
  2408.         Returns:    <list>(<int> total bytes <int> free bytes <int>
  2409.                     sector size <int> sectors per cluster)
  2410.         Notes:
  2411.         Example:    (setq     dstat       (getdiskfree 0)
  2412.                               sector      (cadddr dstat)
  2413.                               cluster     (* sector (caddr dstat))
  2414.                               drive_bytes (* cluster (car dstat))
  2415.                               free_bytes  (* cluster (cadr dstat))
  2416.                     )
  2417.  
  2418.                      ----------------------------------------
  2419.  
  2420.  
  2421.         ELF Functions                                             page 35
  2422.  
  2423.  
  2424.         Function:   getdisk                                     Directory
  2425.  
  2426.         Synopsis:   returns the current drive number (A=1, B=2, C=3, etc)
  2427.         Prototype:  (getdisk)
  2428.         Arguments:  none
  2429.         Returns:    <int> current drive
  2430.         Notes:
  2431.         Example:    (setq DriveStr (sprintf "%c:" (+(getdisk)(1-(ascii
  2432.                     "A"))))
  2433.  
  2434.                      ----------------------------------------
  2435.  
  2436.         Function:   load_dirs                                   Directory
  2437.  
  2438.         Synopsis:   returns a list of strings containing file directories
  2439.                     from the current directory
  2440.         Prototype:  (load_dirs)
  2441.         Arguments:  none
  2442.         Returns:    <list> A list of directories if successful or nil
  2443.                     otherwise
  2444.         Notes:      uses DOS findfirst and findnext
  2445.         Example:    (setq dirs (load_dirs))
  2446.  
  2447.                      ----------------------------------------
  2448.  
  2449.         Function:   load_drives                                 Directory
  2450.  
  2451.         Synopsis:   returns a list of strings containing all valid disk
  2452.                     drives
  2453.         Prototype:  (load_drives)
  2454.         Arguments:  none
  2455.         Returns:    <list> A list of drives if successful or nil
  2456.                     otherwise
  2457.         Notes:
  2458.         Example:    (setq drives (load_drives))
  2459.  
  2460.                      ----------------------------------------
  2461.  
  2462.         Function:   load_files                                  Directory
  2463.  
  2464.         Synopsis:   returns a list of strings containing files matching a
  2465.                     filespec and directory attribute
  2466.         Prototype:  (load_files filespec attribute)
  2467.         Arguments:  <string>  filespec            optional path and file
  2468.                                                   specification, default:
  2469.                                                   "*.*"
  2470.         Returns:    <int>     attribute           optional bit coded file
  2471.                                                   attributes (see
  2472.                                                   findfirst), default: 33
  2473.                     <list> A list of files if successful or nil otherwise
  2474.  
  2475.  
  2476.         ELF Functions                                             page 36
  2477.  
  2478.  
  2479.         Notes:
  2480.         Example:    (setq files (qsort(load_files "D:\DWGS\*.DWG")))
  2481.  
  2482.                      ----------------------------------------
  2483.  
  2484.         Function:   makepath                                    Directory
  2485.  
  2486.         Synopsis:   Combines the four components into a full DOS path
  2487.                     string
  2488.         Prototype:  (makepath drive dir name ext)
  2489.         Arguments:  see (splitpath)
  2490.         Returns:    <string> full path string
  2491.         Notes:
  2492.         Example:    (makepath "D:" "\ACAD\SUPPORT\" "ACAD" ".LSP")
  2493.  
  2494.                      ----------------------------------------
  2495.  
  2496.         Function:   mkdir                                       Directory
  2497.  
  2498.         Synopsis:   creates a new directory
  2499.         Prototype:  (mkdir dirname)
  2500.                     directory <string> directory to create
  2501.         Arguments:  <string>  directory name if successful or nil
  2502.                               otherwise
  2503.         Returns:
  2504.         Notes:      (mkdir "\newdir")
  2505.         Example:
  2506.  
  2507.                      ----------------------------------------
  2508.  
  2509.         Function:   rmdir                                       Directory
  2510.  
  2511.         Synopsis:   removes (deletes) a directory
  2512.         Prototype:  (rmdir dirname)
  2513.         Arguments:  directory      <string> directory to remove
  2514.         Returns:    <string> current directory if successful or nil
  2515.                     otherwise
  2516.         Notes:
  2517.         Example:    (rmdir "\olddir")
  2518.  
  2519.                      ----------------------------------------
  2520.  
  2521.         Function:   setdisk                                     Directory
  2522.  
  2523.         Synopsis:   logs to the specified disk drive
  2524.         Prototype:  (setdisk drive)
  2525.         Arguments:  drive     <int>               drive number (A=1, B=2,
  2526.                                                   C=3, etc)
  2527.         Returns:    <int>     current drive if successful or nil
  2528.         Notes:
  2529.         Example:    (setdisk 3) ;;; make drive C: current
  2530.  
  2531.                      ----------------------------------------
  2532.  
  2533.  
  2534.         ELF Functions                                             page 37
  2535.  
  2536.  
  2537.         Function:   splitpath                                   Directory
  2538.  
  2539.         Synopsis:   splits a DOS path string into its four components
  2540.         Prototype:  (splitpath path)
  2541.         Arguments:  path      <string> full DOS path to a file
  2542.         Returns:    a <list> containing four strings:
  2543.                     drive     the drive character followed by a ':' (eg
  2544.                               "C:")
  2545.                     dir       the directory (eg "\ACAD\SUPPORT"
  2546.                     name      the name of the file (eg "ACAD")
  2547.                     ext       a period followed by the file extension
  2548.                               (eg ".LSP")
  2549.         Notes:
  2550.         Example:    (setq
  2551.                       plist (splitpath "D:\ACAD\SUPPORT\ACAD.LSP")
  2552.                       drive (car plist)           ;;; "D:"
  2553.   dir (cadr plist)            ;;; "\ACAD\SUPPORT\"
  2554.                       name (caddr plist)          ;;; "ACAD"
  2555.                       ext (cadddr plist)          ;;; ".LSP"
  2556.                     )
  2557.  
  2558.                      ----------------------------------------
  2559.  
  2560.         Function:   unlink                                      Directory
  2561.  
  2562.         Synopsis:   erase file(s)
  2563.         Prototype:  (unlink filename)
  2564.         Arguments:  filename <string> - file to erase
  2565.         Returns:    1 - success
  2566.                     0 - fail
  2567.         Notes:      unlink and erasefile are identical
  2568.         Example:    (unlink "thisfile.dat")
  2569.  
  2570.                      ----------------------------------------
  2571.  
  2572.         File Functions
  2573.  
  2574.         ELF  contains file  handling functions  to  speed file  handling.
  2575.         AutoLISP provides  functions to read  and write  to text files  a
  2576.         character and a  line at a time.  ELF adds functions to  read and
  2577.         write the entire file in one step. 
  2578.  
  2579.         The function (read_file)  will return the  contents of an  entire
  2580.         file and  can be used  to quickly load  the contents of  the file
  2581.         into  an AutoLISP symbol.  (write_file) inverses the  process and
  2582.         will write  the entire contents of  an AutoLISP string  list to a
  2583.         file. These functions are much faster than looping through a list
  2584.         and reading/writing a line at a time with AutoLISP.
  2585.  
  2586.                      ----------------------------------------
  2587.  
  2588.  
  2589.         ELF Functions                                             page 38
  2590.  
  2591.  
  2592.         Function:   copyfile                                         File
  2593.  
  2594.         Synopsis:   copies file(s)
  2595.         Prototype:  (copyfile source destination)
  2596.         Arguments:  <string>  source path
  2597.                     <string>  destination path
  2598.         Returns:    number of files copied if successful, nil otherwise
  2599.         Notes:      The destination can be a either a file or directory.
  2600.                     Both input and output streams are buffered to improve
  2601.                     copy speed.
  2602.         Example:    (copyfile "C:\ACAD\*.DAT" "D:")
  2603.  
  2604.                      ----------------------------------------
  2605.  
  2606.         Function:   look                                             File
  2607.  
  2608.         Synopsis:   displays an ASCII file to screen using the ELF file
  2609.                     viewer
  2610.         Prototype:  (look filespec)
  2611.         Arguments:  <filespec>     filename or wildcard filespec to view
  2612.         Returns:    1 if successful, nil otherwise
  2613.         Notes:
  2614.         Example:    (look "C:\ACAD\*.DOC"
  2615.  
  2616.                      ----------------------------------------
  2617.  
  2618.         Function:   movefile                                         File
  2619.  
  2620.         Synopsis:   moves / renames file(s)
  2621.         Prototype:  (movefile source destination)
  2622.         Arguments:  <string>  source path
  2623.                     <string>  destination path
  2624.         Returns:    number of files moved if successful, nil otherwise
  2625.         Notes:      destination must be on the same drive
  2626.         Example:    (movefile "C:\ACAD\*.DAT" "C:\DATDIR")
  2627.  
  2628.                      ----------------------------------------
  2629.  
  2630.         Function:   read_file                                        File
  2631.  
  2632.         Synopsis:   reads an ASCII file and returns a string list from
  2633.                     file records. Each line in the text file is parsed
  2634.                     into a string and appended to the returned list.
  2635.         Prototype:  (read_file filespec mode)
  2636.         Arguments:  <string>  filespec            file specification of
  2637.                                                   the file to read
  2638.                     <int>     mode                type of list to create
  2639.                                                   (see return value)
  2640.  
  2641.  
  2642.         ELF Functions                                             page 39
  2643.  
  2644.  
  2645.         Returns:    <list>    A list whose contents are dependant on
  2646.                               mode
  2647.                     Value     Meaning             
  2648.                     0 or nil  A list of strings
  2649.                     1         A list of dotted pairs containing a 0
  2650.                               based sequential value and a string
  2651.         Notes:      The dotted pair list can be accessed randomly using
  2652.                     the (assoc) function.
  2653.         Example:    (read_file "FOO.BAR" 1)
  2654.  
  2655.                      ----------------------------------------
  2656.  
  2657.         Function:   write_file                                       File
  2658.  
  2659.         Synopsis:   opens an ASCII file and writes a string list to the
  2660.                     file and then closes the file. Each string is placed
  2661.                     in the text file as a line of text.
  2662.         Prototype:  (write_file filespec type)
  2663.         Arguments:  <string>  filespec            file specification of
  2664.                                                   the file to write
  2665.                     <string>  type                how the file will be
  2666.                                                   opened, "a" appends to
  2667.                                                   the end of the file,
  2668.                                                   otherwise a new file
  2669.                                                   will be created and any
  2670.                                                   other character is
  2671.                                                   ignored.
  2672.                     <list>    A list of strings
  2673.         Returns:    <int>     the number of lines written
  2674.         Notes:
  2675.         Example:    (write_file "FOO.BAR" "a" "This is data") ;;; appends
  2676.                     a line to file FOO.BAR
  2677.  
  2678.                      ----------------------------------------
  2679.  
  2680.         Math Functions
  2681.  
  2682.         ELF expands the AutoLISP math library with additional math, trig,
  2683.         and logical functions.
  2684.  
  2685.                      ----------------------------------------
  2686.  
  2687.         Function:   |                                              Math
  2688.  
  2689.         Synopsis:   returns the result of a bitwise OR of the arguments
  2690.         Prototype:  (| ...)
  2691.         Arguments:  ...       <int>               any number of integer
  2692.                                                   values
  2693.         Returns:    <int>     the result of the bitwise OR
  2694.         Notes:
  2695.         Example:    (setq color (| lgrey blue_bg))
  2696.  
  2697.                      ----------------------------------------
  2698.  
  2699.  
  2700.         ELF Functions                                             page 40
  2701.  
  2702.  
  2703.         Function:   ||                                               Math
  2704.  
  2705.         Synopsis:   returns the result of a logical OR of the arguments
  2706.         Prototype:  (|| ...)
  2707.         Arguments:  ...       <int>               any number of integer
  2708.                                                   values
  2709.         Returns:    <int>     the result of the logical OR
  2710.         Notes:
  2711.         Example:
  2712.  
  2713.                      ----------------------------------------
  2714.  
  2715.         Function:   &                                                Math
  2716.  
  2717.         Synopsis:   returns the result of a bitwise AND of the arguments
  2718.         Prototype:  (& ...)
  2719.         Arguments:  ...       <int>               any number of integer
  2720.                                                   values
  2721.         Returns:    <int>     the result of the bitwise AND
  2722.         Notes:
  2723.         Example:
  2724.  
  2725.                      ----------------------------------------
  2726.  
  2727.         Function:   &&                                               Math
  2728.  
  2729.         Synopsis:   returns the result of a logical AND of the arguments
  2730.         Prototype:  (&& ...)
  2731.         Arguments:  ...       <int>               any number of integer
  2732.                                                   values
  2733.         Returns:    <int>     the result of the logical AND
  2734.         Notes:
  2735.         Example:
  2736.  
  2737.                      ----------------------------------------
  2738.  
  2739.         Function:   acos                                             Math
  2740.  
  2741.         Synopsis:   returns the inverse cosine of the argument
  2742.         Prototype:  (acos rad)
  2743.         Arguments:  rad       <real>              angle in radians
  2744.         Returns:    <real>
  2745.         Notes:
  2746.         Example:
  2747.  
  2748.                      ----------------------------------------
  2749.  
  2750.         Function:   asin                                             Math
  2751.  
  2752.         Synopsis:   returns the inverse sine of the argument
  2753.         Prototype:  (asin rad)
  2754.         Arguments:  rad       <real>              angle in radians
  2755.         Returns:    <real>
  2756.  
  2757.  
  2758.         ELF Functions                                             page 41
  2759.  
  2760.  
  2761.         Notes:
  2762.         Example:
  2763.  
  2764.                      ----------------------------------------
  2765.  
  2766.         Function:   ceil                                             Math
  2767.  
  2768.         Synopsis:   returns the smallest integer greater or equal to the
  2769.                     argument
  2770.         Prototype:  (ceil rval)
  2771.         Arguments:  rval      <real>
  2772.         Returns:    <real>
  2773.         Notes:
  2774.         Example:    (ceil 7.5)     ;;; returns 8.0
  2775.                     (ceil -7.5)    ;;; returns -7.0
  2776.  
  2777.                      ----------------------------------------
  2778.  
  2779.         Function:   cosh                                             Math
  2780.  
  2781.         Synopsis:   returns the hyperbolic cosine of the argument
  2782.         Prototype:  (cosh rad)
  2783.         Arguments:  rad       <real>              angle in radians
  2784.         Returns:    <real>
  2785.         Notes:
  2786.         Example:
  2787.  
  2788.                      ----------------------------------------
  2789.  
  2790.         Function:   dtr                                              Math
  2791.  
  2792.         Synopsis:   converts an angle in degrees to radians
  2793.         Prototype:  (dtr ang)
  2794.         Arguments:  ang       <real>              angle in degrees
  2795.         Returns:    <real>    the angle in radians
  2796.         Notes:
  2797.         Example:    (setq rad (dtr deg))
  2798.  
  2799.                      ----------------------------------------
  2800.  
  2801.         Function:   floor                                            Math
  2802.  
  2803.         Synopsis:   returns the largest integer not greater than the
  2804.                     argument
  2805.         Prototype:  (floor rval)
  2806.         Arguments:  rval      <real>
  2807.         Returns:    <real>
  2808.         Notes:
  2809.         Example:    (floor 7.5)  ;;; returns 7.0
  2810.                     (floor -7.5) ;;; returns -8.0
  2811.  
  2812.                      ----------------------------------------
  2813.  
  2814.  
  2815.         ELF Functions                                             page 42
  2816.  
  2817.  
  2818.         Function:   hibyte                                           Math
  2819.  
  2820.         Synopsis:   returns the upper (most significant) byte of an
  2821.                     integer
  2822.         Prototype:  (hibyte val)
  2823.         Arguments:  val       <int>               an integer value
  2824.         Returns:    <int>     an integer value containing the MSB
  2825.         Notes:
  2826.         Example:    (setq keycode (getkey) ;;; get a keypress
  2827.                       char (lobyte keycode) ;;;the character value
  2828.                       scancode (hibyte keycode) ;;; the keyboard scancode
  2829.                     )
  2830.  
  2831.                      ----------------------------------------
  2832.  
  2833.         Function:   lobyte                                           Math
  2834.  
  2835.         Synopsis:   returns the lower (least significant) byte of an
  2836.                     integer
  2837.         Prototype:  (lobyte val)
  2838.         Arguments:  val       <int>               an integer value
  2839.         Returns:    <int>     an integer value containing the LSB
  2840.         Notes:
  2841.         Example:    see hibyte
  2842.  
  2843.                      ----------------------------------------
  2844.  
  2845.         Function:   log10                                            Math
  2846.  
  2847.         Synopsis:   returns the logarithm to the base 10 of the argument
  2848.         Prototype:  (log10 x)
  2849.         Arguments:  x         <real>
  2850.         Returns:    <real>    or nil of x <= 0.0
  2851.         Notes:
  2852.         Example:
  2853.  
  2854.                      ----------------------------------------
  2855.  
  2856.         Function:   rand                                             Math
  2857.  
  2858.         Synopsis:   generates a pseudo random number
  2859.         Prototype:  (rand)
  2860.         Arguments:
  2861.         Returns:    <real>    a random value (actually a long integer)
  2862.         Notes:      the sequence has a period of 2^32
  2863.         Example:    (setq x (fix(rem(rand 10))))
  2864.  
  2865.                      ----------------------------------------
  2866.  
  2867.         Function:   round                                            Math
  2868.  
  2869.         Synopsis:   rounds a real value
  2870.         Prototype:  (round val places)
  2871.  
  2872.  
  2873.         ELF Functions                                             page 43
  2874.  
  2875.  
  2876.         Arguments:  val       <real>              the value to round
  2877.                     places    <int>               the number of places to
  2878.                                                   the right of the
  2879.                                                   decimal
  2880.         Returns:    <real>    the rounded value
  2881.         Notes:
  2882.         Example:    (setq pct (round val 2))
  2883.  
  2884.                      ----------------------------------------
  2885.  
  2886.         Function:   rtd                                              Math
  2887.  
  2888.         Synopsis:   converts an angle in radians to degrees
  2889.         Prototype:  (rtd ang)
  2890.         Arguments:  ang       <real>              angle in radians
  2891.         Returns:    <real>    the angle in degrees
  2892.         Notes:
  2893.         Example:    (setq deg (rtd rad))
  2894.  
  2895.                      ----------------------------------------
  2896.  
  2897.         Function:   sinh                                             Math
  2898.  
  2899.         Synopsis:   returns the hyperbolic sine of the argument
  2900.         Prototype:  (sinh rad)
  2901.         Arguments:  rad       <real>              angle in radians
  2902.         Returns:    <real>
  2903.         Notes:
  2904.         Example:
  2905.  
  2906.                      ----------------------------------------
  2907.  
  2908.         Function:   srand                                            Math
  2909.  
  2910.         Synopsis:   seeds the random number generator
  2911.         Prototype:  (srand i)
  2912.         Arguments:  i         <int>               optional seed value
  2913.                                                   (default = 1)
  2914.         Returns:
  2915.         Notes:
  2916.         Example:    (srand pi)
  2917.  
  2918.                      ----------------------------------------
  2919.  
  2920.         Function:   tan                                              Math
  2921.  
  2922.         Synopsis:   returns the trigonometric tangent of the argument
  2923.         Prototype:  (tan rad)
  2924.         Arguments:  rad       <real>              angle in radians
  2925.         Returns:    <real>
  2926.  
  2927.  
  2928.         ELF Functions                                             page 44
  2929.  
  2930.  
  2931.         Notes:
  2932.         Example:
  2933.  
  2934.                      ----------------------------------------
  2935.  
  2936.         Function:   tanh                                             Math
  2937.  
  2938.         Synopsis:   returns the hyperbolic tangent of the argument
  2939.         Prototype:  (tanh rad)
  2940.         Arguments:  rad       <real>              angle in radians
  2941.         Returns:    <real>
  2942.         Notes:
  2943.         Example:
  2944.  
  2945.                      ----------------------------------------
  2946.  
  2947.         List Handling Functions
  2948.  
  2949.         The list  data structure  is a  central part  of  LISP. ELF  adds
  2950.         functions to manipulate single dimension AutoLISP arrays. You can
  2951.         sort, insert, delete, replace, and find elements in a list.
  2952.  
  2953.                      ----------------------------------------
  2954.  
  2955.         Function:   bsearch                                          List
  2956.  
  2957.         Synopsis:   located a value in a sorted string, integer or real
  2958.                     value list
  2959.         Prototype:  (bsearch vlist key)
  2960.         Arguments:  vlist     <list>              list of string,
  2961.                                                   integer, or real values
  2962.                     key       <atom>              string, integer, or
  2963.                                                   real value to locate
  2964.         Returns:    <int>     0 based index if found or nil if not found
  2965.         Notes:      the list must be sorted and of type string, integer,
  2966.                     or real
  2967.         Example:    (setq sl (qsort '("CC" "BB" "AA")) ;;; returns ("AA"
  2968.                     "BB" "CC")
  2969.                     (bsearch sl "AA") ;;; returns 0
  2970.  
  2971.                      ----------------------------------------
  2972.  
  2973.         Function:   delete                                           List
  2974.  
  2975.         Synopsis:   deletes a list or atom from another list
  2976.         Prototype:  (delete list pos)
  2977.         Arguments:  list      <list>              list
  2978.                                                   a list
  2979.                     pso       <int>               0 based position to
  2980.                                                   insert
  2981.         Returns:    new list
  2982.  
  2983.  
  2984.         ELF Functions                                             page 45
  2985.  
  2986.  
  2987.         Notes:
  2988.         Example:    (setq new_list(delete old_list 3)) ;;; deletes 4th
  2989.                     element
  2990.  
  2991.                      ----------------------------------------
  2992.  
  2993.         Function:   insert                                           List
  2994.  
  2995.         Synopsis:   inserts a list or atom into another list
  2996.         Prototype:  (insert list pos item)
  2997.         Arguments:  list      <list>              a list
  2998.                     pos       <int>               0 based position to
  2999.                                                   insert
  3000.                     <list> or <atom>              val
  3001.                                                   the list or value to
  3002.                                                   insert
  3003.         Returns:    new list
  3004.         Notes:
  3005.         Example:    (setq new_list (insert old_list 3 '("XX" "YY" 123)))
  3006.  
  3007.                      ----------------------------------------
  3008.  
  3009.         Function:   lfind                                            List
  3010.  
  3011.         Synopsis:   located a value in an unsorted string, integer or
  3012.                     real value list
  3013.         Prototype:  (lfind vlist key)
  3014.         Arguments:  vlist     <list>              list of string,
  3015.                                                   integer, or real values
  3016.                     key       <atom>              string, integer, or
  3017.                                                   real value to find
  3018.         Returns:    <int>     0 based index if found or nil if not found
  3019.         Notes:      the list must be of type string, integer, or real
  3020.         Example:    (setq sl '("CC" "BB" "AA"))
  3021.                     (lfind sl "AA") ;;; returns 2
  3022.  
  3023.                      ----------------------------------------
  3024.  
  3025.         Function:   lsearch                                          List
  3026.  
  3027.         Synopsis:   located a value in a string, integer or real value
  3028.                     list
  3029.         Prototype:  (lsearch vlist key)
  3030.         Arguments:  vlist     <list>              list of string,
  3031.                                                   integer, or real values
  3032.                     key       <atom>              string, integer, or
  3033.                                                   real value to locate
  3034.         Returns:    <int>     vlist if found or vlist with key appended
  3035.                               if not found
  3036.  
  3037.  
  3038.         ELF Functions                                             page 46
  3039.  
  3040.  
  3041.         Notes:      the list must be of type string, integer, or real
  3042.         Example:    (setq sl '("CC" "BB" "AA"))
  3043.                     (lsearch sl "XX") ;;; returns ("CC "BB" "AA" "XX")
  3044.  
  3045.                      ----------------------------------------
  3046.  
  3047.         Function:   qsort                                            List
  3048.  
  3049.         Synopsis:   sorts a string, integer or real value list
  3050.         Prototype:  (qsort lst)
  3051.         Arguments:  lst       <list>              list of string,
  3052.                                                   integer, or real values
  3053.         Returns:    <list>    sorted list
  3054.         Notes:
  3055.         Example:    (qsort '("CC" "BB "AA")) ;;; returns ("AA" "BB" "CC")
  3056.                     (qsort '(3 2 1) ;;; returns (1 2 3)
  3057.  
  3058.                      ----------------------------------------
  3059.  
  3060.         Function:   replace                                          List
  3061.  
  3062.         Synopsis:   replace a list or atom in a list with another
  3063.         Prototype:  (replace list pos item)
  3064.         Arguments:  list      <list>              a list
  3065.                     pos       <int>               0 based position to
  3066.                                                   insert
  3067.                     <list> or <atom>              val
  3068.                                                   the new list or value
  3069.                                                   to substitute
  3070.         Returns:    new list
  3071.         Notes:
  3072.         Example:    (replace old_list 3 "XX")
  3073.  
  3074.                      ----------------------------------------
  3075.  
  3076.         Function:   symbol                                           List
  3077.  
  3078.         Synopsis:   Displays the contents of a symbol to the screen using
  3079.                     the ELF file/symbol viewer.
  3080.         Prototype:  (symbol sym)
  3081.         Arguments:  sym       an AutoLISP symbol / list / function
  3082.         Returns:
  3083.         Notes:      release 12 only
  3084.         Example:    (symbol (qsort(atoms-family 1))) ;;; displays a list
  3085.                     of all symbols
  3086.  
  3087.                      ----------------------------------------
  3088.  
  3089.         String Handling Functions
  3090.  
  3091.         The ELF string library contains functions to scan and modify text
  3092.         strings. In addition, the function (strget) adds a flexible  line
  3093.         editor with an integrated help system.
  3094.  
  3095.  
  3096.         ELF Functions                                             page 47
  3097.  
  3098.  
  3099.                      ----------------------------------------
  3100.  
  3101.         Function:   field                                          String
  3102.  
  3103.         Synopsis:   returns a substring of str1 from token delimiters in
  3104.                     str2 and position.
  3105.         Prototype:  (field str1 str2 pos)
  3106.         Arguments:  str1      <string>            the string to search
  3107.                     str2      <string>            the string containing
  3108.                                                   delimiters
  3109.         Returns:    pos       <int>               the 1 based position in
  3110.                                                   the string
  3111.                     <string>  the nth pos substring of str1 delimited by
  3112.                               chars in str2 or nil
  3113.         Notes:
  3114.         Example:    (field "AA;BB;CC;DD;EE" ";" 2) ;;; returns "BB"
  3115.  
  3116.                      ----------------------------------------
  3117.  
  3118.         Function:   set_edit_help                                  String
  3119.  
  3120.         Synopsis:   sets the user help string list for the function
  3121.                     (strget)
  3122.         Prototype:  (set_edit_help <slist>)
  3123.         Arguments:  <slist>   a string list to be displayed when the F1
  3124.                               key is pressed while in (strget). The
  3125.                               first item in the list will be the help
  3126.                               window title.
  3127.         Returns:
  3128.         Notes:      In release 12 or higher the symbol EDIT_HELP can be
  3129.                     used to set the help string. In release 12
  3130.                     (set_edit_help) will also set this symbol. The symbol
  3131.                     EDIT_HELP can be local to a particular function or
  3132.                     global in scope.
  3133.  
  3134.                     The user can display the default help screen by
  3135.                     pressing F1 the second time.
  3136.         Example:    (set_edit_help '("[ My Help Screen ]" "" "This is my
  3137.                     help message"))
  3138.  
  3139.                      ----------------------------------------
  3140.  
  3141.         Function:   sprintf                                        String
  3142.  
  3143.         Synopsis:   same as printf except that nothing is printed, the
  3144.                     string is returned
  3145.         Prototype:  (sprintf format ...)
  3146.         Arguments:  see printf
  3147.         Returns:    <string>  formatted string
  3148.  
  3149.  
  3150.         ELF Functions                                             page 48
  3151.  
  3152.  
  3153.         Notes:      printf to string
  3154.         Example:    (write-line (sprintf "\n%-10s%10.3g%10d" name salary
  3155.                     age) fp)
  3156.  
  3157.                      ----------------------------------------
  3158.  
  3159.         Function:   strchr                                         String
  3160.  
  3161.         Synopsis:   finds the first occurrence of ch in str and returns a
  3162.                     substring starting at that character
  3163.         Prototype:  (strchr str ch)
  3164.         Arguments:  str       <string>            the string to search
  3165.                     ch        <int>               the character to search
  3166.                                                   for
  3167.         Returns:    <string>  the substring starting in ch
  3168.         Notes:
  3169.         Example:    (strchr "AABBCC" (ascii "B")) ;;; returns "BBCC"
  3170.  
  3171.                      ----------------------------------------
  3172.  
  3173.         Function:   strcmp                                         String
  3174.  
  3175.         Synopsis:   compares two strings for equality (case sensitive)
  3176.         Prototype:  (strcmp str1 str2)
  3177.         Arguments:  str1      <string>            the string compare
  3178.                     str2      <string>            the string compare
  3179.         Returns:    Value     Meaning             
  3180.                     -1        str1 < str2
  3181.                     0         str1 = str2
  3182.                     1         str1 > str2
  3183.         Notes:
  3184.         Example:    (strcmp "Hello World" "HELLO WORLD") returns 1
  3185.  
  3186.                      ----------------------------------------
  3187.  
  3188.         Function:   strcspn                                        String
  3189.  
  3190.         Synopsis:   determine the length of the prefix of str1 made
  3191.                     entirely of chars not in str2
  3192.         Prototype:  (strcspn str1 str2)
  3193.         Arguments:  str1      <string>            the main string
  3194.                     str2      <string>            the string of chars to
  3195.                                                   test
  3196.         Returns:    <string>  the length of the segment of str1 that
  3197.                               begins in the beginning of the string and
  3198.                               is made up entirely of characters that do
  3199.                               not occur in str2
  3200.         Notes:
  3201.         Example:    (strcspn "AABBCCDDEE" "AB") ;;; returns 0
  3202.                     (strcspn "AABBCCDDEE" "D") ;;; returns 6
  3203.  
  3204.                      ----------------------------------------
  3205.  
  3206.  
  3207.         ELF Functions                                             page 49
  3208.  
  3209.  
  3210.         Function:   strdate                                        String
  3211.  
  3212.         Synopsis:   returns the current date from the internal clock as a
  3213.                     formatted string
  3214.         Prototype:  (strdate)
  3215.         Arguments:  none
  3216.         Returns:    date string as MM-DD-YY
  3217.         Notes:
  3218.         Example:    (printf "\nToday is %s" (strdate))
  3219.  
  3220.                      ----------------------------------------
  3221.  
  3222.         Function:   strdela                                        String
  3223.  
  3224.         Synopsis:   delete all occurrences of chars in str2 from str1
  3225.         Prototype:  (strdela str1 str2)
  3226.         Arguments:  str1      <string>            string containing chars
  3227.                                                   to be deleted
  3228.                     str2      <string>            string containing chars
  3229.                                                   to delete
  3230.         Returns:    <string>  str1 with chars from str2 deleted
  3231.         Notes:
  3232.         Example:    (setq str (strdela "This\t is a test;;::///"
  3233.                     "\t;:/"))
  3234.  
  3235.                      ----------------------------------------
  3236.  
  3237.         Function:   strget                                         String
  3238.  
  3239.         Synopsis:   edit a string on the text screen with cursor
  3240.                     positioning and editing, background mask, color
  3241.                     attribute control, and on line help.
  3242.         Prototype:  (strget str len curpos mask attr ...)
  3243.         Arguments:  str       <string>            optional string to edit
  3244.                                                   (default - "")
  3245.                     curpos    <int>               optional starting
  3246.                                                   cursor position within
  3247.                                                   string (default - 0)
  3248.                     len       <int>               optional edit field
  3249.                                                   length (default 80)
  3250.                     mask      <int>               optional background
  3251.                                                   mask character (default
  3252.                                                   - " ")
  3253.                     attr      <int>               optional color
  3254.                                                   attribute (default -
  3255.                                                   "color: symbol)
  3256.                     ...       <int>               optional keycodes which
  3257.                                                   will cause strget to
  3258.                                                   exit (in addition to
  3259.                                                   <Esc>, <Up>, <Down>,
  3260.                                                   <Enter>, and <Ctrl-
  3261.                                                   Enter>
  3262.  
  3263.  
  3264.         ELF Functions                                             page 50
  3265.  
  3266.  
  3267.         Returns:    <list>
  3268.                     <string>  the edited string
  3269.                     <int>     keycode of key causing function to exit
  3270.                     <int>     cursor position within string at exit
  3271.         Notes:      strget prints the string and mask at the cursor
  3272.                     position then waits for user input. The cursor is
  3273.                     placed at <curpos> within the string.
  3274.                     Insert/overwrite mode is saved between calls to
  3275.                     strget. If a string longer than <len> is edited the
  3276.                     string will "ticker tape", the maximum string length
  3277.                     is 255 characters. Response to keystrokes is as
  3278.                     follows:
  3279.                     Key       Action              
  3280.                     <Left>    move cursor left
  3281.                     <Right>   move cursor right
  3282.                     <Up>      exit
  3283.                     <Down>    exit
  3284.                     <Enter>   exit
  3285.                     <Ctrl-Enter>   exit
  3286.                     <F1>      Display help screen, if the symbol
  3287.                               EDIT_HELP is defined, then the contants of
  3288.                               that symbol is displayed. In versions
  3289.                               prior to release 12, the function
  3290.                               (set_edit_help) can be used to set the
  3291.                               user defined help. 
  3292.  
  3293.                               If the user presses F1 the second time,
  3294.                               then the default help screen is displayed.
  3295.                     <Ctrl-Rt> word right
  3296.                     <Ctrl-Lt> word left
  3297.                     <Ctrl-Y>  delete from cursor to end of line
  3298.                     <End>     move to end
  3299.                     <Home>    move to start
  3300.                     <Ins>     toggle insert / overwrite mode
  3301.         Example:    (setq name (strget name 25 0 (ascii "_") 23 15360);;;
  3302.                     <F2> will cause strget to exit strget also
  3303.  
  3304.                      ----------------------------------------
  3305.  
  3306.         Function:   stricmp                                        String
  3307.  
  3308.         Synopsis:   compares two strings for equality (case insensitive)
  3309.         Prototype:  (stricmp str1 str2)
  3310.         Arguments:  str1      <string>            the string compare
  3311.                     str2      <string>            the string compare
  3312.         Returns:    Value     Meaning             
  3313.                     -1        str1 < str2
  3314.                     0         str1 = str2
  3315.                     1         str1 > str2
  3316.         Notes:
  3317.         Example:    (stricmp "Hello World" "HELLO WORLD") returns 0
  3318.  
  3319.                      ----------------------------------------
  3320.  
  3321.  
  3322.         ELF Functions                                             page 51
  3323.  
  3324.  
  3325.         Function:   strncpy                                        String
  3326.  
  3327.         Synopsis:   copies the first n characters of a string
  3328.         Prototype:  (strncpy str n)
  3329.         Arguments:  str       <string>            the string to copy
  3330.                     n         <int>               the number of
  3331.                                                   characters to copy
  3332.         Returns:    <string>  the copied string
  3333.         Notes:
  3334.         Example:    (strncpy "Hello World" 8) ;;; returns "Hello Wo"
  3335.  
  3336.                      ----------------------------------------
  3337.  
  3338.         Function:   strnset                                        String
  3339.  
  3340.         Synopsis:   fills a string
  3341.         Prototype:  (strnset char len)
  3342.         Arguments:  char      <int>               character to use to
  3343.                                                   fill string
  3344.                     len       <int>               number of characters
  3345.         Returns:    <string>  the filled string
  3346.         Notes:
  3347.         Example:    (strnset (ascii " ") 40) ;;; returns a string of 40
  3348.                     spaces
  3349.  
  3350.                      ----------------------------------------
  3351.  
  3352.         Function:   strpbrk                                        String
  3353.  
  3354.         Synopsis:   returns a substring of the first occurrence of any
  3355.                     character of str2 in str1
  3356.         Prototype:  (strstr str1 str2)
  3357.         Arguments:  str1      <string>            the string to search
  3358.                     str2      <string>            the substring
  3359.         Returns:    <string>  the substring starting in any char in str2
  3360.         Notes:
  3361.         Example:    (strpbrk "AABBCCDDEE" "CCBB") ;;; returns "BBCCDDEE"
  3362.  
  3363.                      ----------------------------------------
  3364.  
  3365.         Function:   strrchr                                        String
  3366.  
  3367.         Synopsis:   finds the last occurrence of ch in str and returns a
  3368.                     substring starting at that character
  3369.         Prototype:  (strrchr str ch)
  3370.         Arguments:  str       <string>            the string to search
  3371.                     ch        <int>               the character to search
  3372.                                                   for
  3373.         Returns:    <string>  the substring starting in ch
  3374.         Notes:
  3375.         Example:    (strrchr "AABBCC" (ascii "B")) ;;; returns "BCC"
  3376.  
  3377.                      ----------------------------------------
  3378.  
  3379.  
  3380.         ELF Functions                                             page 52
  3381.  
  3382.  
  3383.         Function:   strrev                                         String
  3384.  
  3385.         Synopsis:   returns the string argument with the character order
  3386.                     reversed
  3387.         Prototype:  (strrev str)
  3388.         Arguments:  str       <string>            string to be reverses
  3389.         Returns:    <string>  the reverses string
  3390.         Notes:
  3391.         Example:    (setq revs (strrev "ABCDE"));;; returns "EDCBA"
  3392.  
  3393.                      ----------------------------------------
  3394.  
  3395.         Function:   strspn                                         String
  3396.  
  3397.         Synopsis:   determine the length of the prefix of str1 made
  3398.                     entirely of chars in str2
  3399.         Prototype:  (strspn str1 str2)
  3400.         Arguments:  str1      <string>            the main string
  3401.                     str2      <string>            the string of chars to
  3402.                                                   test
  3403.         Returns:    <string>  the length of the segment of str1 that
  3404.                               begins in the beginning of the string and
  3405.                               is made up entirely of characters that
  3406.                               occur in str2
  3407.         Notes:
  3408.         Example:    (strspn "AABBCCDDEE" "AB") ;;; returns 4
  3409.  
  3410.                      ----------------------------------------
  3411.  
  3412.         Function:   strstr                                         String
  3413.  
  3414.         Synopsis:   returns a substring of the first occurrence of str2
  3415.                     in str1
  3416.         Prototype:  (strstr str1 str2)
  3417.         Arguments:  str1      <string>            the string to search
  3418.                     str2      <string>            the substring
  3419.         Returns:    <string>  the substring starting in str2
  3420.         Notes:
  3421.         Example:    (strstr "AABBCCDDEE" "CC") ;;; returns "CCDDEE"
  3422.  
  3423.                      ----------------------------------------
  3424.  
  3425.         Function:   strswap                                        String
  3426.  
  3427.         Synopsis:   swaps all occurrences of char1 with char2 in str
  3428.         Prototype:  (strswap str char1 char2)
  3429.         Arguments:  str       <string>            string to search
  3430.                     char1     <int>               character to search for
  3431.         Returns:    char2     <int>               character to substitute
  3432.                                                   for char1
  3433.  
  3434.  
  3435.         ELF Functions                                             page 53
  3436.  
  3437.  
  3438.         Notes:      <string>  the string with swapped chars
  3439.         Example:
  3440.  
  3441.                      ----------------------------------------
  3442.  
  3443.         Function:   strtime                                        String
  3444.  
  3445.         Synopsis:   returns the current time from the internal clock as a
  3446.                     formatted string
  3447.         Prototype:  (strtime)
  3448.         Arguments:  none
  3449.         Returns:    time string as HH:MM:SS
  3450.         Notes:
  3451.         Example:    (printf "\nThe current time is %s" (strtime))
  3452.  
  3453.                      ----------------------------------------
  3454.  
  3455.         Function:   strtok                                         String
  3456.  
  3457.         Synopsis:   returns the first substring of str1 from token
  3458.                     delimiters in str2. subsequent calls after the first
  3459.                     with no arguments will return the second and any
  3460.                     further substrings
  3461.         Prototype:  (strtok str1 str2)
  3462.         Arguments:  str1      <string>            the string to search
  3463.                     str2      <string>            the string containing
  3464.                                                   tokens delimiters
  3465.         Returns:    <string>  the substring of str1 up but not including
  3466.                               any chars in str2
  3467.         Notes:
  3468.         Example:    (setq s2 (strtok "AA;BB;CC;DD;EE" ";"))
  3469.                               ;;; returns "AA" and saves "BB;CC;DD;EE"
  3470.                               internally
  3471.                     (while (boundp 's2)
  3472.                       (print s2)
  3473.                       (setq s2 (strtok)) ;; then returns "BB", etc
  3474.                     )
  3475.  
  3476.                      ----------------------------------------
  3477.  
  3478.         Function:   strtrim                                        String
  3479.  
  3480.         Synopsis:   trim white space (all char values < '!') from the
  3481.                     beginning (left side) and end (right side); and
  3482.                     compresses white space within a string to a single
  3483.                     space between words
  3484.         Prototype:  (strtrim str)
  3485.         Arguments:  str       <string> the string to be trimmed
  3486.         Returns:    <string>  trimmed string if success or nil if error
  3487.  
  3488.  
  3489.         ELF Functions                                             page 54
  3490.  
  3491.  
  3492.         Notes:
  3493.         Example:    (strtrim "\t\t     Hello   \t  world\t     ")
  3494.                     returns: "Hello World"
  3495.  
  3496.                      ----------------------------------------
  3497.  
  3498.         Function:   strtriml                                       String
  3499.  
  3500.         Synopsis:   trim white space from the beginning (left side) of a
  3501.                     string
  3502.         Prototype:  (strtriml str)
  3503.         Arguments:  str       <string> the string to be trimmed
  3504.         Returns:    <string>  trimmed string if success or nil if error
  3505.         Notes:
  3506.         Example:    (strtriml "\t\t     Hello world")
  3507.                     returns: "Hello World"
  3508.  
  3509.                      ----------------------------------------
  3510.  
  3511.         Function:   strtrimr                                       String
  3512.  
  3513.         Synopsis:   trim white space from the end (right side) of a
  3514.                     string
  3515.         Prototype:  (strtrimr str)
  3516.         Arguments:  str       <string> the string to be trimmed
  3517.         Returns:    <string>  trimmed string if success or nil if error
  3518.         Notes:
  3519.         Example:    (strtrimr "Hello world\t     ")
  3520.                     returns: "Hello World"
  3521.  
  3522.                      ----------------------------------------
  3523.  
  3524.         Function:   tolower                                        String
  3525.  
  3526.         Synopsis:
  3527.         Prototype:  (tolower char)
  3528.         Arguments:  char      <int>
  3529.         Returns:    <char>    character converted to lower case
  3530.         Notes:
  3531.         Example:    (chr(tolower(ascii "A"))) ;;; returns: "a"
  3532.  
  3533.                      ----------------------------------------
  3534.  
  3535.         Function:   toupper                                        String
  3536.  
  3537.         Synopsis:
  3538.         Prototype:  (toupper char)
  3539.         Arguments:  char      <int>
  3540.         Returns:    <char>    character converted to upper case
  3541.         Notes:
  3542.         Example:    (chr(toupper(ascii "a"))) ;;; returns: "A"
  3543.  
  3544.                      ----------------------------------------
  3545.  
  3546.  
  3547.         ELF Functions                                             page 55
  3548.  
  3549.  
  3550.         Character Classification Functions
  3551.  
  3552.         The character classification  functions are  equivalent to  those
  3553.         from the "C" function library except that they return nil instead
  3554.         of 0  to indicate  a FALSE  condition. This  allows the  AutoLISP
  3555.         programmer to test the expression directly with an (if) function.
  3556.  
  3557.         eg.       (If(IsUpper ch) (do something))
  3558.  
  3559.                      ----------------------------------------
  3560.  
  3561.         Function:   isalnum                                     Character
  3562.  
  3563.         Synopsis:   returns a non-zero value if argument is a letter or
  3564.                     digit
  3565.         Prototype:  (isalnum char)
  3566.         Arguments:  char      <int>
  3567.         Returns:    <int>     non-zero if true, nil otherwise
  3568.         Notes:
  3569.         Example:
  3570.  
  3571.                      ----------------------------------------
  3572.  
  3573.         Function:   isascii                                     Character
  3574.  
  3575.         Synopsis:   returns a non-zero value if argument is an ASCII
  3576.                     character
  3577.         Prototype:  (isascii char)
  3578.         Arguments:  char      <int>
  3579.         Returns:    <int>     non-zero if true, nil otherwise
  3580.         Notes:
  3581.         Example:
  3582.  
  3583.                      ----------------------------------------
  3584.  
  3585.         Function:   iscntl                                      Character
  3586.  
  3587.         Synopsis:   returns a non-zero value if argument is a control
  3588.                     character
  3589.         Prototype:  (iscntl char)
  3590.         Arguments:  char      <int>
  3591.         Returns:    <int>     non-zero if true, nil otherwise
  3592.         Notes:
  3593.         Example:
  3594.  
  3595.                      ----------------------------------------
  3596.  
  3597.         Function:   isdigit                                     Character
  3598.  
  3599.         Synopsis:   returns a non-zero value if argument is a numeric
  3600.                     digit
  3601.         Prototype:  (isdigit char)
  3602.         Arguments:  char      <int>
  3603.  
  3604.  
  3605.         ELF Functions                                             page 56
  3606.  
  3607.  
  3608.         Returns:    <int>     non-zero if true, nil otherwise
  3609.         Notes:
  3610.         Example:
  3611.  
  3612.                      ----------------------------------------
  3613.  
  3614.         Function:   isgraph                                     Character
  3615.  
  3616.         Synopsis:   returns a non-zero value if argument is a visible
  3617.                     printable character
  3618.         Prototype:  (isgraph char)
  3619.         Arguments:  char      <int>
  3620.         Returns:    <int>     non-zero if true, nil otherwise
  3621.         Notes:
  3622.         Example:
  3623.  
  3624.                      ----------------------------------------
  3625.  
  3626.         Function:   islower                                     Character
  3627.  
  3628.         Synopsis:   returns a non-zero value if argument is a lower case
  3629.                     letter
  3630.         Prototype:  (islower char)
  3631.         Arguments:  char      <int>
  3632.         Returns:    <int>     non-zero if true, nil otherwise
  3633.         Notes:
  3634.         Example:
  3635.  
  3636.                      ----------------------------------------
  3637.  
  3638.         Function:   isodigit                                    Character
  3639.  
  3640.         Synopsis:   returns a non-zero value if argument is an octal
  3641.                     digit (0-7)
  3642.         Prototype:  (isodigit char)
  3643.         Arguments:  char      <int>
  3644.         Returns:    <int>     non-zero if true, nil otherwise
  3645.         Notes:
  3646.         Example:
  3647.  
  3648.                      ----------------------------------------
  3649.  
  3650.         Function:   isprint                                     Character
  3651.  
  3652.         Synopsis:   returns a non-zero value if argument is a printable
  3653.                     character
  3654.         Prototype:  (isprint char)
  3655.         Arguments:  char      <int>
  3656.         Returns:    <int>     non-zero if true, nil otherwise
  3657.         Notes:
  3658.         Example:
  3659.  
  3660.                      ----------------------------------------
  3661.  
  3662.  
  3663.         ELF Functions                                             page 57
  3664.  
  3665.  
  3666.         Function:   ispunct                                     Character
  3667.  
  3668.         Synopsis:   returns a non-zero value if argument is a punctuation
  3669.                     character
  3670.         Prototype:  (ispunct char)
  3671.         Arguments:  char      <int>
  3672.         Returns:    <int>     non-zero if true, nil otherwise
  3673.         Notes:
  3674.         Example:
  3675.  
  3676.                      ----------------------------------------
  3677.  
  3678.         Function:   isspace                                     Character
  3679.  
  3680.         Synopsis:   returns a non-zero value if argument is a white-space
  3681.                     character (space, tab, newline, etc)
  3682.         Prototype:  (isspace char)
  3683.         Arguments:  char      <int>
  3684.         Returns:    <int>     non-zero if true, nil otherwise
  3685.         Notes:
  3686.         Example:
  3687.  
  3688.                      ----------------------------------------
  3689.  
  3690.         Function:   isupper                                     Character
  3691.  
  3692.         Synopsis:   returns a non-zero value if argument is an upper case
  3693.                     letter
  3694.         Prototype:  (isupper char)
  3695.         Arguments:  char      <int>
  3696.         Returns:    <int>     non-zero if true, nil otherwise
  3697.         Notes:
  3698.         Example:
  3699.  
  3700.                      ----------------------------------------
  3701.  
  3702.         Function:   isxdigit                                    Character
  3703.  
  3704.         Synopsis:   returns a non-zero value if argument is a hexadecimal
  3705.                     digit (0-F)
  3706.         Prototype:  (isxdigit char)
  3707.         Arguments:  char      <int>
  3708.         Returns:    <int>     non-zero if true, nil otherwise
  3709.         Notes:
  3710.         Example:
  3711.  
  3712.                      ----------------------------------------
  3713.  
  3714.         Utility / Miscellaneous Functions
  3715.  
  3716.         Utility functions include those to  control the PC speaker,  read
  3717.         the PC  system clock, for  program debugging, and  to execute DOS
  3718.         programs under program control.
  3719.  
  3720.  
  3721.         ELF Functions                                             page 58
  3722.  
  3723.  
  3724.                      ----------------------------------------
  3725.  
  3726.         Function:   adsdump                                       Utility
  3727.  
  3728.         Synopsis:   prints the data type and value of an AutoLISP symbol
  3729.         Prototype:  (adsdump sym)
  3730.         Arguments:  sym       <symbol>            an AutoLISP symbol
  3731.         Returns:
  3732.         Notes:
  3733.         Example:    (setq x (load_dirs))
  3734.                     (adsdump x)
  3735.  
  3736.                      ----------------------------------------
  3737.  
  3738.         Function:   beep                                          Utility
  3739.  
  3740.         Synopsis:   sound a beep on the PC speaker for optional frequency
  3741.                     and duration
  3742.         Prototype:  (beep freq duration)
  3743.         Arguments:  freq      <int>               frequency in hertz
  3744.                     duration  <real>              length/duration of the
  3745.                                                   beep in decimal seconds
  3746.         Returns:
  3747.         Notes:
  3748.         Example:    (beep 440 1.0) ;;; beep middle A for one second
  3749.  
  3750.                      ----------------------------------------
  3751.  
  3752.         Function:   clock                                         Utility
  3753.  
  3754.         Synopsis:   reads the current internal clock
  3755.         Prototype:  (clock)
  3756.         Arguments:  none
  3757.         Returns:    <real>    the current internal clock register
  3758.                               reading in seconds (0.01 second precision)
  3759.         Notes:
  3760.         Example:    (setq end (+(clock) 2.5)) ;;; delay for 2.5 seconds
  3761.                     (while (> end (clock)))
  3762.  
  3763.                      ----------------------------------------
  3764.  
  3765.         Function:   exit                                          Utility
  3766.  
  3767.         Synopsis:   cancels execution and returns to the Command: prompt
  3768.         Prototype:  (exit)
  3769.         Arguments:
  3770.         Returns:
  3771.         Notes:      duplicates the (exit) function available in release
  3772.                     12 for pre-release 12 versions
  3773.         Example:
  3774.  
  3775.                      ----------------------------------------
  3776.  
  3777.  
  3778.         ELF Functions                                             page 59
  3779.  
  3780.  
  3781.         Function:   getdosver                                     Utility
  3782.  
  3783.         Synopsis:   returns the DOS version
  3784.         Prototype:  (getdosver)
  3785.         Arguments:
  3786.         Returns:    <list>
  3787.                     <int>     major version number
  3788.                     <int>     minor version number
  3789.         Notes:
  3790.         Example:    (set ver (getdosver))
  3791.                     (printf "DOS Version %d.%d" (car ver) (cadr ver))
  3792.  
  3793.                      ----------------------------------------
  3794.  
  3795.         Function:   last_error                                    Utility
  3796.  
  3797.         Synopsis:   returns the last internal error message
  3798.         Prototype:  (last_error)
  3799.         Arguments:
  3800.         Returns:    <string>  the error message
  3801.         Notes:      with release 12 the symbol *LAST_ERROR* also contains
  3802.                     this message
  3803.         Example:    (printf "\nThe last ELF error was %s" (last_error))
  3804.  
  3805.                      ----------------------------------------
  3806.  
  3807.         Function:   nosound                                       Utility
  3808.  
  3809.         Synopsis:   turns off the PC speaker after a sound function
  3810.         Prototype:  (nosound)
  3811.         Arguments:
  3812.         Returns:
  3813.         Notes:
  3814.         Example:    see sound
  3815.  
  3816.                      ----------------------------------------
  3817.  
  3818.         Function:   pause_key                                     Utility
  3819.  
  3820.         Synopsis:   prints "press any key to continue..." and waits for a
  3821.                     keystroke
  3822.         Prototype:  (pause_key)
  3823.         Arguments:
  3824.         Returns:
  3825.         Notes:
  3826.         Example:
  3827.  
  3828.                      ----------------------------------------
  3829.  
  3830.         Function:   sound                                         Utility
  3831.  
  3832.         Synopsis:   turns on the PC speaker at a specified tone frequency
  3833.         Prototype:  (sound freq)
  3834.  
  3835.  
  3836.         ELF Functions                                             page 60
  3837.  
  3838.  
  3839.         Arguments:  freq      <int>               frequency in hertz
  3840.         Returns:
  3841.         Notes:      see beep
  3842.         Example:    (defun play(freq time)
  3843.                       (sound freq) ;;; turn on note
  3844.                       (wait time)  ;;; wait time seconds
  3845.                       (nosound) ;;; turn it off
  3846.                     )
  3847.                     (play 440 0.5);;; sounds middle A for 1/2 second
  3848.  
  3849.                      ----------------------------------------
  3850.  
  3851.         Function:   system                                        Utility
  3852.  
  3853.         Synopsis:   executes a DOS command
  3854.         Prototype:  (system cmd)
  3855.         Arguments:  cmd       <string>            DOS command or program
  3856.         Returns:    <int>     DOS errorlevel if successful or -1 on
  3857.                               error
  3858.         Notes:      You MUST run "cfig386 acad -maxreal FFFFh" to
  3859.                     configure the PharLap DOS extender to allow realmode
  3860.                     programs to run (select a value large enough to run
  3861.                     the desired programs). This function is preferable to
  3862.                     SH or SHELL, or executing some programs from an
  3863.                     ACAD.PGP entry, when the return value must be known.
  3864.                     It's also a little faster.
  3865.         Example:    (keystuff "/FRmyfile\n/FSY/QY")
  3866.                     (if(>= (system "123") 0)
  3867.                       (princ "Lotus 123 executed successfully"))
  3868.  
  3869.                      ----------------------------------------
  3870.  
  3871.         Function:   wait                                          Utility
  3872.  
  3873.         Synopsis:   suspend execution for a specified time duration
  3874.         Prototype:  (wait ti)
  3875.         Arguments:  ti        <real>              time in decimal seconds
  3876.         Returns:
  3877.         Notes:
  3878.         Example:    (wait 2.5) ;;; delays for 2.5 seconds
  3879.  
  3880.                      ----------------------------------------
  3881.  
  3882.         Symbols
  3883.         (release 12 or later only)
  3884.  
  3885.         Symbol          Description
  3886.         *last_error*    the last error message string
  3887.         color           default color attribute
  3888.         edit_help       string  list  with   user  defined  help  for  the
  3889.                         (strget) function
  3890.         menu_help       string  list  with  user   defined  help  for  the
  3891.                         (wmenu) function
  3892.  
  3893.  
  3894.         ELF Functions                                             page 61
  3895.  
  3896.  
  3897.         ELF Functions                                             page 62
  3898.  
  3899.  
  3900.         Copyright
  3901.  
  3902.         The  ELF program code and documentation are copyrighted material,
  3903.         registered with the  US Copyright office  and protected under  US
  3904.         and International copyright laws. All rights are reserved.
  3905.  
  3906.  
  3907.         Trademark
  3908.  
  3909.         Mountain  Software and ELF  are trademarks of  Mountain Software.
  3910.         MS-DOS is a registered trademark of Microsoft Corporation. PC-DOS
  3911.         is  a  registered  trademark  of  IBM  Corporation.  AutoCAD  and
  3912.         AutoLISP are registered trademarks of AutoDesk.
  3913.  
  3914.  
  3915.                                       Index
  3916.  
  3917.         *last_error* . . . . . 59, 60      elf  1-11, 17, 27, 30, 37-39,
  3918.         & . . . . . . . . . . . . . 40                     44, 46, 59, 62
  3919.         &&  . . . . . . . . . . . . 40     elfapps . . . . . . .  1, 2, 4
  3920.         | . . . . . . . . .  1, 39, 40     elfdos  . . . . . . .  1, 2, 5
  3921.         ||  . . . . . . . . . . . . 40     entity  . . . . . . . . . 1, 2
  3922.         acad  3-9, 30, 32, 34, 36-38,      erasefile . . . . . . . 32, 37
  3923.                                     60     esc . . . . . .  8, 20, 23, 49
  3924.         acadapp . . . . . . . . . .  3     exit  .  8, 22, 23, 49, 50, 58
  3925.         access  . . . . . . . . 20, 30     exp . . . . . . . . .  1, 3, 4
  3926.         acos  . . . . . . . . . . . 40     exsubr  . . . . . . . . . .  9
  3927.         ads . . . . . . . . . . . 3, 4     f1   8, 11, 17, 18, 23, 47, 50
  3928.         adsdump . . . . . . . . . . 58     ff  . . . . . . . . . . . .  7
  3929.         asin  . . . . . . . . . . . 40     field . . . . . . . 29, 47, 49
  3930.         attr  10, 12-15, 18, 19, 23, 2     file_exists . . . . . . . . 32
  3931.                              5, 26, 49     findfile  . . . . . . . . 3, 7
  3932.         attribute  1, 10-15, 17-20, 22     findfirst . . . . .  20, 32-35
  3933.                   -26, 32, 33, 35, 49,     findnext  . . . . . . .  33-35
  3934.                                     60     flipscreen  . . . . . . . . 11
  3935.         autocad . . . 1-5, 7, 9-11, 62     floor . . . . . . . . . . . 41
  3936.         autodesk  . . . . . . .  1, 62     floppy  . . . . . .  6, 19, 31
  3937.         autolisp  1-5, 9, 10, 12, 15,      fullpath  . . . . . . . . . 34
  3938.                   17, 33, 34, 37, 39,      get_cursor  . . . . . .  14-16
  3939.                     44, 46, 55, 58, 62     get_video . . . . . 12, 13, 15
  3940.         beep  . . . . . . . 10, 58, 60     getch . . . . . . .  1, 27, 28
  3941.         boundp  . . . . . . . . 34, 53     getche  . . . . . . . .  1, 28
  3942.         box . . . . . . . . . . . . 12     getdir  . . . . . . . . . . 34
  3943.         bsearch . . . . . . . . . . 44     getdisk . . . . . . . . . . 35
  3944.         capslock  . . . . . . . . . 29     getdiskfree . . . . . . . . 34
  3945.         cd  . . . . . . . . . . . .  5     getdosver . . . . . . . . . 59
  3946.         ceil  . . . . . . . . . . . 41     getkey  . . . . . 1, 27-29, 42
  3947.         chdir . . . . . . . . .  5, 30     getxy . . . . . . . 15, 16, 21
  3948.         chpath  . . . . . . . . . . 31     gotoxy  . . . . . . . . 15, 16
  3949.         clock . . .  2, 49, 53, 57, 58     hibyte  . . . . . . . . 28, 42
  3950.         cls . . . . . . . . . .  5, 12     insert  . . . 2, 29, 44-46, 50
  3951.         color  1, 3, 10-15, 17-20, 22-     isalnum . . . . . . . . . . 55
  3952.                         26, 39, 49, 60     isascii . . . . . . . . 11, 55
  3953.         commands  . . . . . . 1-3, 5-9     iscntl  . . . . . . . . . . 55
  3954.         copyfile  . . . . . . . . . 38     isdigit . . . . . . . . . . 55
  3955.         cosh  . . . . . . . . . . . 41     isgraph . . . . . . . . . . 56
  3956.         dcd . . . . . . . . . . . .  5     islower . . . . . . . . . . 56
  3957.         dcopy . . . . . . . . . . 5, 6     isodigit  . . . . . . . . . 56
  3958.         ddel  . . . . . . . . . . .  6     isprint . . . . . . . . . . 56
  3959.         ddir  . . . . . . . . . . .  6     ispunct . . . . . . . . . . 57
  3960.         delete  2, 6, 8, 44, 45, 49, 5     isspace . . . . . . . . . . 57
  3961.                                      0     isupper . . . . . . . . 55, 57
  3962.         derase  . . . . . . . . . .  6     isxdigit  . . . . . . . . . 57
  3963.         dir . . . .  6, 10, 26, 36, 37     kbhit . . . . . . . . .  1, 28
  3964.         dmd . . . . . . . . . . . .  8     key_clear . . . . . . . . . 29
  3965.         dmove . . . . . . . . . . 6, 7     key_ready . . . . . . . . . 29
  3966.         drd . . . . . . . . . . . .  8     key_stat  . . . . . . . . . 29
  3967.         drename . . . . . . . . . .  6     key_stuff . . . . . 27, 29, 30
  3968.         dsd . . . . . . . . . . . .  9     keycode  4, 22, 23, 28, 29, 42
  3969.         dtr . . . . . . . . . . . . 41                               , 50
  3970.         edit_help . . . . . 47, 50, 60     keycodes  . . . . . . . 28, 49
  3971.  
  3972.  
  3973.         keystuff  . . . . . . . . . 60     shareware . . . . . . . . 1, 2
  3974.         last_error  . . . . . . 59, 60     sinh  . . . . . . . . . . . 43
  3975.         len . . . . . . . .  19, 49-51     solid . . . . . . . . . . . 24
  3976.         lfind . . . . . . . . . . . 45     sound . . . .  1, 2, 10, 58-60
  3977.         line  1, 2, 6, 8, 16-19, 22-24     splitpath . . . . . . . 36, 37
  3978.                   , 26, 37, 38, 39, 46     sprintf . . . . . . 35, 47, 48
  3979.                                , 48-50     srand . . . . . . . . . . . 43
  3980.         list  1, 2, 6, 7, 10-12, 16, 1     strchr  . . . . . . . . . . 48
  3981.                   7, 21, 22, 23, 28, 3     strcmp  . . . . . . . . . . 48
  3982.                   0, 33-35, 37-39, 44-     strcspn . . . . . . . . . . 48
  3983.                         47, 50, 59, 60     strdate . . . . . . . . . . 49
  3984.         load_dirs . . . . . . . 35, 58     strdela . . . . . . . . . . 49
  3985.         load_files  . . . . . . 35, 36     strget  19, 46, 47, 49, 50, 60
  3986.         lobyte  . . . . . . . . 28, 42     stricmp . . . . . . . . . . 50
  3987.         log10 . . . . . . . . . . . 42     string  1, 2, 10, 11, 13-15, 1
  3988.         look  . . . . . .  7-9, 17, 38               7-20, 22, 23, 25-39,
  3989.         lsearch . . . . . . . . 45, 46                      44-54, 59, 60
  3990.         lsp . .  4, 12, 27, 28, 36, 37     strncpy . . . . . . . . . . 51
  3991.         makepath  . . . . . . . . . 36     strnset . . . . . . . . . . 51
  3992.         md  . . . . . . . . . . . .  8     strpbrk . . . . . . . . . . 51
  3993.         menu_help . . . 17, 18, 23, 60     strrchr . . . . . . . . . . 51
  3994.         mkdir . . . . . . . . .  8, 36     strrev  . . . . . . . . . . 52
  3995.         movefile  . . . . . . . . . 38     strspn  . . . . . . . . . . 52
  3996.         nosound . . . . . . . . 59, 60     strstr  . . . . . . . . 51, 52
  3997.         numlock . . . . . . . . . . 29     strswap . . . . . . . . . . 52
  3998.         password  . . . . . . . . .  8     strtime . . . . . . . . . . 53
  3999.         pause_key . . . . . . . . . 59     strtok  . . . . . . . . . . 53
  4000.         pgdn  . . . . . . . . .  8, 23     strtrim . . . . . . . . 53, 54
  4001.         pgp . . . . . . . . . . . . 60     strtriml  . . . . . . . . . 54
  4002.         pgup  . . . . . . . . .  8, 23     strtrimr  . . . . . . . . . 54
  4003.         pharlap . . . . . . . . . . 60     subr  . . . . . . . . . . .  9
  4004.         point . . . . . . . . . . . 10     substring . . .  47, 48, 51-53
  4005.         popup . . . . . . . . . . .  1     substrings  . . . . . . . . 53
  4006.         printf  1, 10, 11, 13, 15, 25,     symbol  1, 2, 5, 9-11, 15, 17-
  4007.                    34, 47, 48, 49, 53,               19, 22, 23, 25, 37,
  4008.                                     59               46, 47, 49, 50, 58,
  4009.         prts  . . . . . . . . . . . 13                             59, 60
  4010.         puts  . . . . . . . 13, 14, 26     system  1, 11, 17, 30, 33, 46,
  4011.         qsort . . . . .  9, 36, 44, 46                             57, 60
  4012.         radians . . 10, 40, 41, 43, 44     tan . . . . . . . . . . . . 43
  4013.         rand  . . . . . . . . . 11, 42     tanh  . . . . . . . . . . . 44
  4014.         rd  . . . . . . . . . . . 8, 9     text  1, 5, 8, 11-15, 17, 19,
  4015.         read_file . . . . . . .  37-39               23-26, 37-39, 46, 49
  4016.         replace . . . . . .  2, 44, 46     tolower . . . . . . . . . . 54
  4017.         rmdir . . . . . . . . .  8, 36     toupper . . . . . . . . . . 54
  4018.         round . . . . . . . . . 42, 43     unlink  . . . . . . . . . . 37
  4019.         rtd . . . . . . . . . . . . 43     utility . . . . .  1, 2, 57-60
  4020.         scancode  . . . . . . . 28, 42     ver . . . . . . . . . .  9, 59
  4021.         scr_fill  . . . . . . . 14, 15     wait  . . . . . . . . . 23, 60
  4022.         scr_printf  . . . . . . 11, 15     wclose  . . . . . . . . . . 18
  4023.         sd  . . . . . . . . . . . .  9     wcloseall . . . . . . . . . 18
  4024.         set_cursor  . . . . . .  14-17     wclreol . . . . . . . . . . 18
  4025.         setdisk . . . . . . . . . . 36     wcls  . . . . . . . . . 18, 19
  4026.         setq  9, 13, 15, 16, 20, 21, 2     wgetdrive . . . . . . . 19, 20
  4027.                   3, 24, 28, 29, 34-37     wgetfile  . . . . . . .  8, 20
  4028.                   , 39, 41-46, 49, 50,     wgetstr . . . . . . . . . . 19
  4029.                             52, 53, 58     wgetxy  . . . . . . . . . . 21
  4030.  
  4031.  
  4032.         wgotoxy . . . . . . . . . . 21
  4033.         winfo . . . . . . . . . . . 21
  4034.         wmenu . . . . . 17, 22, 23, 60
  4035.         wmsg  . . . . . . . . . 23, 24
  4036.         wopen . . . . . . . . . . . 24
  4037.         wpopup  . . . . . . 19, 24, 25
  4038.         wprintf . . . . . . . . . . 25
  4039.         wprts . . . . . . . . . 17, 25
  4040.         wputcen . . . . . . . . . . 25
  4041.         wputs . . . . . . . . . 17, 26
  4042.         write_file  . . . . . . 37, 39
  4043.         wscroll . . . . . . . . . . 26
  4044.         wshadow . . . . . . . . 26, 27
  4045.         wtitle  . . . . . . . . . . 27
  4046.         xload . . . . . . . . . . .  3
  4047.  
  4048.